diff --git a/plugin/deploy/appfog.go b/plugin/deploy/appfog.go deleted file mode 100644 index 716db6ccb..000000000 --- a/plugin/deploy/appfog.go +++ /dev/null @@ -1,12 +0,0 @@ -package deploy - -import ( - "github.com/drone/drone/shared/build/buildfile" -) - -type AppFog struct { -} - -func (a *AppFog) Write(f *buildfile.Buildfile) { - -} diff --git a/plugin/deploy/cloudcontrol.go b/plugin/deploy/cloudcontrol.go deleted file mode 100644 index 3d16a681d..000000000 --- a/plugin/deploy/cloudcontrol.go +++ /dev/null @@ -1,12 +0,0 @@ -package deploy - -import ( - "github.com/drone/drone/shared/build/buildfile" -) - -type CloudControl struct { -} - -func (c *CloudControl) Write(f *buildfile.Buildfile) { - -} diff --git a/plugin/deploy/deployment.go b/plugin/deploy/deployment.go index 1f28cf69b..635fdfc92 100644 --- a/plugin/deploy/deployment.go +++ b/plugin/deploy/deployment.go @@ -2,6 +2,9 @@ package deploy import ( "github.com/drone/drone/plugin/condition" + "github.com/drone/drone/plugin/deploy/git" + "github.com/drone/drone/plugin/deploy/heroku" + "github.com/drone/drone/plugin/deploy/tsuru" "github.com/drone/drone/shared/build/buildfile" "github.com/drone/drone/shared/build/repo" ) @@ -10,18 +13,14 @@ import ( // for deploying build artifacts when // a Build has succeeded type Deploy struct { - AppFog *AppFog `yaml:"appfog,omitempty"` - CloudControl *CloudControl `yaml:"cloudcontrol,omitempty"` - CloudFoundry *CloudFoundry `yaml:"cloudfoundry,omitempty"` - EngineYard *EngineYard `yaml:"engineyard,omitempty"` - Git *Git `yaml:"git,omitempty"` - Heroku *Heroku `yaml:"heroku,omitempty"` - Modulus *Modulus `yaml:"modulus,omitempty"` - Nodejitsu *Nodejitsu `yaml:"nodejitsu,omitempty"` - Openshift *Openshift `yaml:"openshift,omitempty"` - SSH *SSH `yaml:"ssh,omitempty"` - Tsuru *Tsuru `yaml:"tsuru,omitempty"` - Bash *Bash `yaml:"bash,omitempty"` + CloudFoundry *CloudFoundry `yaml:"cloudfoundry,omitempty"` + Git *git.Git `yaml:"git,omitempty"` + Heroku *heroku.Heroku `yaml:"heroku,omitempty"` + Modulus *Modulus `yaml:"modulus,omitempty"` + Nodejitsu *Nodejitsu `yaml:"nodejitsu,omitempty"` + SSH *SSH `yaml:"ssh,omitempty"` + Tsuru *tsuru.Tsuru `yaml:"tsuru,omitempty"` + Bash *Bash `yaml:"bash,omitempty"` } func (d *Deploy) Write(f *buildfile.Buildfile, r *repo.Repo) { diff --git a/plugin/deploy/engineyard.go b/plugin/deploy/engineyard.go deleted file mode 100644 index 8ffa814ae..000000000 --- a/plugin/deploy/engineyard.go +++ /dev/null @@ -1,12 +0,0 @@ -package deploy - -import ( - "github.com/drone/drone/shared/build/buildfile" -) - -type EngineYard struct { -} - -func (e *EngineYard) Write(f *buildfile.Buildfile) { - -} diff --git a/plugin/deploy/git.go b/plugin/deploy/git.go deleted file mode 100644 index 451dc8411..000000000 --- a/plugin/deploy/git.go +++ /dev/null @@ -1,50 +0,0 @@ -package deploy - -import ( - "fmt" - "github.com/drone/drone/plugin/condition" - "github.com/drone/drone/shared/build/buildfile" -) - -type Git struct { - Target string `yaml:"target,omitempty"` - Force bool `yaml:"force,omitempty"` - Branch string `yaml:"branch,omitempty"` - - Condition *condition.Condition `yaml:"when,omitempty"` -} - -func (g *Git) Write(f *buildfile.Buildfile) { - // get the current commit hash - f.WriteCmdSilent("COMMIT=$(git rev-parse HEAD)") - - // set the git user and email based on the individual - // that made the commit. - f.WriteCmdSilent("git config --global user.name $(git --no-pager log -1 --pretty=format:'%an')") - f.WriteCmdSilent("git config --global user.email $(git --no-pager log -1 --pretty=format:'%ae')") - - // add target as a git remote - f.WriteCmd(fmt.Sprintf("git remote add deploy %s", g.Target)) - - destinationBranch := g.Branch - if destinationBranch == "" { - destinationBranch = "master" - } - - switch g.Force { - case true: - // this is useful when the there are artifacts generated - // by the build script, such as less files converted to css, - // that need to be deployed to git remote. - f.WriteCmd(fmt.Sprintf("git add -A")) - f.WriteCmd(fmt.Sprintf("git commit -m 'add build artifacts'")) - f.WriteCmd(fmt.Sprintf("git push deploy HEAD:%s --force", destinationBranch)) - case false: - // otherwise we just do a standard git push - f.WriteCmd(fmt.Sprintf("git push deploy $COMMIT:%s", destinationBranch)) - } -} - -func (g *Git) GetCondition() *condition.Condition { - return g.Condition -} diff --git a/plugin/deploy/heroku.go b/plugin/deploy/heroku.go deleted file mode 100644 index 3c90ed82a..000000000 --- a/plugin/deploy/heroku.go +++ /dev/null @@ -1,45 +0,0 @@ -package deploy - -import ( - "fmt" - "github.com/drone/drone/plugin/condition" - "github.com/drone/drone/shared/build/buildfile" -) - -type Heroku struct { - App string `yaml:"app,omitempty"` - Force bool `yaml:"force,omitempty"` - Branch string `yaml:"branch,omitempty"` - - Condition *condition.Condition `yaml:"when,omitempty"` -} - -func (h *Heroku) Write(f *buildfile.Buildfile) { - // get the current commit hash - f.WriteCmdSilent("COMMIT=$(git rev-parse HEAD)") - - // set the git user and email based on the individual - // that made the commit. - f.WriteCmdSilent("git config --global user.name $(git --no-pager log -1 --pretty=format:'%an')") - f.WriteCmdSilent("git config --global user.email $(git --no-pager log -1 --pretty=format:'%ae')") - - // add heroku as a git remote - f.WriteCmd(fmt.Sprintf("git remote add heroku git@heroku.com:%s.git", h.App)) - - switch h.Force { - case true: - // this is useful when the there are artifacts generated - // by the build script, such as less files converted to css, - // that need to be deployed to Heroku. - f.WriteCmd(fmt.Sprintf("git add -A")) - f.WriteCmd(fmt.Sprintf("git commit -m 'adding build artifacts'")) - f.WriteCmd(fmt.Sprintf("git push heroku HEAD:master --force")) - case false: - // otherwise we just do a standard git push - f.WriteCmd(fmt.Sprintf("git push heroku $COMMIT:master")) - } -} - -func (h *Heroku) GetCondition() *condition.Condition { - return h.Condition -} diff --git a/plugin/deploy/openshift.go b/plugin/deploy/openshift.go deleted file mode 100644 index 749b4353a..000000000 --- a/plugin/deploy/openshift.go +++ /dev/null @@ -1,12 +0,0 @@ -package deploy - -import ( - "github.com/drone/drone/shared/build/buildfile" -) - -type Openshift struct { -} - -func (o *Openshift) Write(f *buildfile.Buildfile) { - -} diff --git a/plugin/deploy/tsuru.go b/plugin/deploy/tsuru.go deleted file mode 100644 index 2a074b5dd..000000000 --- a/plugin/deploy/tsuru.go +++ /dev/null @@ -1,45 +0,0 @@ -package deploy - -import ( - "fmt" - "github.com/drone/drone/plugin/condition" - "github.com/drone/drone/shared/build/buildfile" -) - -type Tsuru struct { - Force bool `yaml:"force,omitempty"` - Branch string `yaml:"branch,omitempty"` - Remote string `yaml:"remote,omitempty"` - - Condition *condition.Condition `yaml:"when,omitempty"` -} - -func (t *Tsuru) Write(f *buildfile.Buildfile) { - // get the current commit hash - f.WriteCmdSilent("COMMIT=$(git rev-parse HEAD)") - - // set the git user and email based on the individual - // that made the commit. - f.WriteCmdSilent("git config --global user.name $(git --no-pager log -1 --pretty=format:'%an')") - f.WriteCmdSilent("git config --global user.email $(git --no-pager log -1 --pretty=format:'%ae')") - - // add tsuru as a git remote - f.WriteCmd(fmt.Sprintf("git remote add tsuru %s", t.Remote)) - - switch t.Force { - case true: - // this is useful when the there are artifacts generated - // by the build script, such as less files converted to css, - // that need to be deployed to Tsuru. - f.WriteCmd(fmt.Sprintf("git add -A")) - f.WriteCmd(fmt.Sprintf("git commit -m 'adding build artifacts'")) - f.WriteCmd(fmt.Sprintf("git push tsuru HEAD:master --force")) - case false: - // otherwise we just do a standard git push - f.WriteCmd(fmt.Sprintf("git push tsuru $COMMIT:master")) - } -} - -func (t *Tsuru) GetCondition() *condition.Condition { - return t.Condition -}