mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-25 08:38:43 +00:00
Merge pull request #116 from fiveisprime/modulus-deployments
Adds support for Modulus deployments
This commit is contained in:
commit
dc478a4ca8
2 changed files with 25 additions and 0 deletions
|
@ -14,6 +14,7 @@ type Deploy struct {
|
||||||
EngineYard *EngineYard `yaml:"engineyard,omitempty"`
|
EngineYard *EngineYard `yaml:"engineyard,omitempty"`
|
||||||
Git *Git `yaml:"git,omitempty"`
|
Git *Git `yaml:"git,omitempty"`
|
||||||
Heroku *Heroku `yaml:"heroku,omitempty"`
|
Heroku *Heroku `yaml:"heroku,omitempty"`
|
||||||
|
Modulus *Modulus `yaml:"modulus,omitempty"`
|
||||||
Nodejitsu *Nodejitsu `yaml:"nodejitsu,omitempty"`
|
Nodejitsu *Nodejitsu `yaml:"nodejitsu,omitempty"`
|
||||||
Openshift *Openshift `yaml:"openshift,omitempty"`
|
Openshift *Openshift `yaml:"openshift,omitempty"`
|
||||||
SSH *SSH `yaml:"ssh,omitempty"`
|
SSH *SSH `yaml:"ssh,omitempty"`
|
||||||
|
@ -38,6 +39,9 @@ func (d *Deploy) Write(f *buildfile.Buildfile) {
|
||||||
if d.Heroku != nil {
|
if d.Heroku != nil {
|
||||||
d.Heroku.Write(f)
|
d.Heroku.Write(f)
|
||||||
}
|
}
|
||||||
|
if d.Modulus != nil {
|
||||||
|
d.Modulus.Write(f)
|
||||||
|
}
|
||||||
if d.Nodejitsu != nil {
|
if d.Nodejitsu != nil {
|
||||||
d.Nodejitsu.Write(f)
|
d.Nodejitsu.Write(f)
|
||||||
}
|
}
|
||||||
|
|
21
pkg/plugin/deploy/modulus.go
Normal file
21
pkg/plugin/deploy/modulus.go
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
package deploy
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/drone/drone/pkg/build/buildfile"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Modulus struct {
|
||||||
|
Project string `yaml:"project,omitempty"`
|
||||||
|
Token string `yaml:"token,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Modulus) Write(f *buildfile.Buildfile) {
|
||||||
|
f.WriteEnv("MODULUS_TOKEN", m.Token)
|
||||||
|
|
||||||
|
// Install the Modulus command line interface then deploy the configured
|
||||||
|
// project.
|
||||||
|
f.WriteCmdSilent("[ -f /usr/bin/sudo ] || npm install -g modulus")
|
||||||
|
f.WriteCmdSilent("[ -f /usr/bin/sudo ] && sudo npm install -g modulus")
|
||||||
|
f.WriteCmd(fmt.Sprintf("modulus deploy -p '%s'", m.Project))
|
||||||
|
}
|
Loading…
Reference in a new issue