mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 00:46:30 +00:00
Supporting skip_clone
This commit is contained in:
parent
f386c4fca3
commit
e239c2fe74
3 changed files with 4 additions and 2 deletions
|
@ -97,7 +97,7 @@ func (c *Compiler) Compile(conf *yaml.Config) *backend.Config {
|
|||
}
|
||||
|
||||
// add default clone step
|
||||
if c.local == false && len(conf.Clone.Containers) == 0 {
|
||||
if c.local == false && len(conf.Clone.Containers) == 0 && !conf.SkipClone {
|
||||
container := &yaml.Container{
|
||||
Name: "clone",
|
||||
Image: "plugins/git:latest",
|
||||
|
@ -118,7 +118,7 @@ func (c *Compiler) Compile(conf *yaml.Config) *backend.Config {
|
|||
stage.Steps = append(stage.Steps, step)
|
||||
|
||||
config.Stages = append(config.Stages, stage)
|
||||
} else if c.local == false {
|
||||
} else if c.local == false && !conf.SkipClone {
|
||||
for i, container := range conf.Clone.Containers {
|
||||
if !container.Constraints.Match(c.metadata) {
|
||||
continue
|
||||
|
|
|
@ -24,6 +24,7 @@ type (
|
|||
Labels libcompose.SliceorMap
|
||||
DependsOn []string `yaml:"depends_on,omitempty"`
|
||||
RunsOn []string `yaml:"runs_on,omitempty"`
|
||||
SkipClone bool `yaml:"skip_clone"`
|
||||
}
|
||||
|
||||
// Workspace defines a pipeline workspace.
|
||||
|
|
|
@ -42,6 +42,7 @@ func TestParse(t *testing.T) {
|
|||
g.Assert(out.DependsOn[1]).Equal("test")
|
||||
g.Assert(out.RunsOn[0]).Equal("success")
|
||||
g.Assert(out.RunsOn[1]).Equal("failure")
|
||||
g.Assert(out.SkipClone).Equal(false)
|
||||
})
|
||||
// Check to make sure variable expansion works in yaml.MapSlice
|
||||
// g.It("Should unmarshal variables", func() {
|
||||
|
|
Loading…
Reference in a new issue