github.com/marinho/drone@v0.2.1-0.20140504195434-d3ba962e89a7/pkg/plugin/deploy/modulus.go (about) 1 package deploy 2 3 import ( 4 "fmt" 5 "github.com/drone/drone/pkg/build/buildfile" 6 ) 7 8 type Modulus struct { 9 Project string `yaml:"project,omitempty"` 10 Token string `yaml:"token,omitempty"` 11 } 12 13 func (m *Modulus) Write(f *buildfile.Buildfile) { 14 f.WriteEnv("MODULUS_TOKEN", m.Token) 15 16 // Install the Modulus command line interface then deploy the configured 17 // project. 18 f.WriteCmdSilent("[ -f /usr/bin/sudo ] || npm install -g modulus") 19 f.WriteCmdSilent("[ -f /usr/bin/sudo ] && sudo npm install -g modulus") 20 f.WriteCmd(fmt.Sprintf("modulus deploy -p '%s'", m.Project)) 21 }