2014-02-07 13:10:01 +03:00
|
|
|
package deploy
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/drone/drone/pkg/build/buildfile"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Nodejitsu struct {
|
2014-03-20 08:35:14 +03:00
|
|
|
App string `yaml:"app,omitempty"`
|
|
|
|
User string `yaml:"user,omitempty"`
|
|
|
|
Token string `yaml:"token,omitempty"`
|
2014-02-07 13:10:01 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (n *Nodejitsu) Write(f *buildfile.Buildfile) {
|
2014-03-20 10:33:45 +03:00
|
|
|
f.WriteEnv("username", n.User)
|
|
|
|
f.WriteEnv("apiToken", n.Token)
|
2014-02-07 13:10:01 +03:00
|
|
|
|
2014-03-20 08:35:14 +03:00
|
|
|
// Install the jitsu command line interface then
|
|
|
|
// deploy the configured app.
|
|
|
|
f.WriteCmdSilent("[ -f /usr/bin/sudo ] || npm install -g jitsu")
|
|
|
|
f.WriteCmdSilent("[ -f /usr/bin/sudo ] && sudo npm install -g jitsu")
|
|
|
|
f.WriteCmd("jitsu deploy")
|
2014-02-07 13:10:01 +03:00
|
|
|
}
|