mirror of
https://github.com/harness/drone.git
synced 2025-05-10 00:11:43 +08:00
[api] First pass at "jitsu deploy". Thanks @fiveisprime!
This commit is contained in:
parent
b1cbc21b2c
commit
33be72b45d
@ -1,12 +1,23 @@
|
|||||||
package deploy
|
package deploy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/drone/drone/pkg/build/buildfile"
|
"github.com/drone/drone/pkg/build/buildfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Nodejitsu struct {
|
type Nodejitsu struct {
|
||||||
|
App string `yaml:"app,omitempty"`
|
||||||
|
User string `yaml:"user,omitempty"`
|
||||||
|
Token string `yaml:"token,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *Nodejitsu) Write(f *buildfile.Buildfile) {
|
func (n *Nodejitsu) Write(f *buildfile.Buildfile) {
|
||||||
|
f.WriteEnv("username", m.User)
|
||||||
|
f.WriteEnv("apiToken", m.Token)
|
||||||
|
|
||||||
|
// 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")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user