2014-03-19 23:36:14 +03:00
|
|
|
package deploy
|
|
|
|
|
|
|
|
import (
|
2014-09-08 09:08:35 +03:00
|
|
|
"github.com/drone/drone/plugin/condition"
|
2014-06-05 00:25:38 +03:00
|
|
|
"github.com/drone/drone/shared/build/buildfile"
|
2014-03-19 23:36:14 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
type Bash struct {
|
2014-03-20 16:18:03 +03:00
|
|
|
Script []string `yaml:"script,omitempty"`
|
|
|
|
Command string `yaml:"command,omitempty"`
|
2014-09-08 09:08:35 +03:00
|
|
|
|
|
|
|
Condition *condition.Condition `yaml:"when,omitempty"`
|
2014-03-19 23:36:14 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (g *Bash) Write(f *buildfile.Buildfile) {
|
2014-03-20 16:18:03 +03:00
|
|
|
g.Script = append(g.Script, g.Command)
|
|
|
|
|
|
|
|
for _, cmd := range g.Script {
|
|
|
|
f.WriteCmd(cmd)
|
|
|
|
}
|
2014-03-19 23:36:14 +03:00
|
|
|
}
|
2014-09-08 09:08:35 +03:00
|
|
|
|
|
|
|
func (g *Bash) GetCondition() *condition.Condition {
|
|
|
|
return g.Condition
|
|
|
|
}
|