From 3920fd92fed4966284b8cccb112e73a4bde350cb Mon Sep 17 00:00:00 2001 From: Matt Hernandez Date: Sun, 23 Feb 2014 12:02:53 -0500 Subject: [PATCH] Added Modulus deployment. Uses the configuration options of: Token (the user's Modulus API token) and project (the project to deploy to). --- pkg/plugin/deploy/modulus.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pkg/plugin/deploy/modulus.go diff --git a/pkg/plugin/deploy/modulus.go b/pkg/plugin/deploy/modulus.go new file mode 100644 index 000000000..192fccef8 --- /dev/null +++ b/pkg/plugin/deploy/modulus.go @@ -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)) +}