From 33be72b45db6ee38cc55a5c6dcc8da6569e54aab Mon Sep 17 00:00:00 2001 From: indexzero Date: Thu, 20 Mar 2014 01:35:14 -0400 Subject: [PATCH] [api] First pass at "jitsu deploy". Thanks @fiveisprime! --- pkg/plugin/deploy/nodejitsu.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/plugin/deploy/nodejitsu.go b/pkg/plugin/deploy/nodejitsu.go index f1680009d..3f854fa40 100644 --- a/pkg/plugin/deploy/nodejitsu.go +++ b/pkg/plugin/deploy/nodejitsu.go @@ -1,12 +1,23 @@ package deploy import ( + "fmt" "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"` } 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") }