1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-18 08:26:45 +02:00
woodpecker/pkg/plugin/deploy/nodejitsu.go

24 lines
588 B
Go
Raw Normal View History

2014-02-07 13:10:01 +03:00
package deploy
import (
"fmt"
2014-02-07 13:10:01 +03:00
"github.com/drone/drone/pkg/build/buildfile"
)
type Nodejitsu struct {
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) {
f.WriteEnv("username", m.User)
f.WriteEnv("apiToken", m.Token)
2014-02-07 13:10:01 +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
}