github.com/unclejack/drone@v0.2.1-0.20140918182345-831b034aa33b/pkg/plugin/deploy/nodejitsu.go (about)

     1  package deploy
     2  
     3  import (
     4  	"github.com/drone/drone/pkg/build/buildfile"
     5  )
     6  
     7  type Nodejitsu struct {
     8  	App   string `yaml:"app,omitempty"`
     9  	User  string `yaml:"user,omitempty"`
    10  	Token string `yaml:"token,omitempty"`
    11  }
    12  
    13  func (n *Nodejitsu) Write(f *buildfile.Buildfile) {
    14  	f.WriteEnv("username", n.User)
    15  	f.WriteEnv("apiToken", n.Token)
    16  
    17  	// Install the jitsu command line interface then
    18  	// deploy the configured app.
    19  	f.WriteCmdSilent("[ -f /usr/bin/sudo ] || npm install -g jitsu")
    20  	f.WriteCmdSilent("[ -f /usr/bin/sudo ] && sudo npm install -g jitsu")
    21  	f.WriteCmd("jitsu deploy")
    22  }