Added Modulus deployment.
Uses the configuration options of: Token (the user's Modulus API token) and project (the project to deploy to).
This commit is contained in:
parent
d6b6506a5b
commit
3920fd92fe
1 changed files with 20 additions and 0 deletions
20
pkg/plugin/deploy/modulus.go
Normal file
20
pkg/plugin/deploy/modulus.go
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
package deploy
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/drone/drone/pkg/build/buildfile"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Modulus struct {
|
||||||
|
Project string `yaml:"project,omitempty"`
|
||||||
|
Token string `yaml:"token,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Modulus) Write(f *buildfile.Buildfile) {
|
||||||
|
f.writeEnv("MODULUS_TOKEN", m.Token)
|
||||||
|
|
||||||
|
// Install the Modulus command line interface then deploy the configured
|
||||||
|
// project.
|
||||||
|
f.WriteCmdSilent("npm install -g modulus")
|
||||||
|
f.WriteCmd(fmt.Sprintf("modulus deploy -p '%s'", m.App))
|
||||||
|
}
|
Loading…
Reference in a new issue