mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-11 18:15:28 +00:00
removed unused deployment file stubs
This commit is contained in:
parent
418e3cab45
commit
5c13d6ba35
8 changed files with 11 additions and 200 deletions
|
@ -1,12 +0,0 @@
|
||||||
package deploy
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/drone/drone/shared/build/buildfile"
|
|
||||||
)
|
|
||||||
|
|
||||||
type AppFog struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *AppFog) Write(f *buildfile.Buildfile) {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
package deploy
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/drone/drone/shared/build/buildfile"
|
|
||||||
)
|
|
||||||
|
|
||||||
type CloudControl struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *CloudControl) Write(f *buildfile.Buildfile) {
|
|
||||||
|
|
||||||
}
|
|
|
@ -2,6 +2,9 @@ package deploy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/drone/drone/plugin/condition"
|
"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/buildfile"
|
||||||
"github.com/drone/drone/shared/build/repo"
|
"github.com/drone/drone/shared/build/repo"
|
||||||
)
|
)
|
||||||
|
@ -10,18 +13,14 @@ import (
|
||||||
// for deploying build artifacts when
|
// for deploying build artifacts when
|
||||||
// a Build has succeeded
|
// a Build has succeeded
|
||||||
type Deploy struct {
|
type Deploy struct {
|
||||||
AppFog *AppFog `yaml:"appfog,omitempty"`
|
CloudFoundry *CloudFoundry `yaml:"cloudfoundry,omitempty"`
|
||||||
CloudControl *CloudControl `yaml:"cloudcontrol,omitempty"`
|
Git *git.Git `yaml:"git,omitempty"`
|
||||||
CloudFoundry *CloudFoundry `yaml:"cloudfoundry,omitempty"`
|
Heroku *heroku.Heroku `yaml:"heroku,omitempty"`
|
||||||
EngineYard *EngineYard `yaml:"engineyard,omitempty"`
|
Modulus *Modulus `yaml:"modulus,omitempty"`
|
||||||
Git *Git `yaml:"git,omitempty"`
|
Nodejitsu *Nodejitsu `yaml:"nodejitsu,omitempty"`
|
||||||
Heroku *Heroku `yaml:"heroku,omitempty"`
|
SSH *SSH `yaml:"ssh,omitempty"`
|
||||||
Modulus *Modulus `yaml:"modulus,omitempty"`
|
Tsuru *tsuru.Tsuru `yaml:"tsuru,omitempty"`
|
||||||
Nodejitsu *Nodejitsu `yaml:"nodejitsu,omitempty"`
|
Bash *Bash `yaml:"bash,omitempty"`
|
||||||
Openshift *Openshift `yaml:"openshift,omitempty"`
|
|
||||||
SSH *SSH `yaml:"ssh,omitempty"`
|
|
||||||
Tsuru *Tsuru `yaml:"tsuru,omitempty"`
|
|
||||||
Bash *Bash `yaml:"bash,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Deploy) Write(f *buildfile.Buildfile, r *repo.Repo) {
|
func (d *Deploy) Write(f *buildfile.Buildfile, r *repo.Repo) {
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
package deploy
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/drone/drone/shared/build/buildfile"
|
|
||||||
)
|
|
||||||
|
|
||||||
type EngineYard struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *EngineYard) Write(f *buildfile.Buildfile) {
|
|
||||||
|
|
||||||
}
|
|
|
@ -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
|
|
||||||
}
|
|
|
@ -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
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
package deploy
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/drone/drone/shared/build/buildfile"
|
|
||||||
)
|
|
||||||
|
|
||||||
type Openshift struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Openshift) Write(f *buildfile.Buildfile) {
|
|
||||||
|
|
||||||
}
|
|
|
@ -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
|
|
||||||
}
|
|
Loading…
Reference in a new issue