add legacy clone option

This commit is contained in:
Brad Rydzewski 2019-10-31 00:11:39 -07:00
parent be6b37e0b4
commit 9036725284
1 changed files with 12 additions and 5 deletions

View File

@ -83,6 +83,13 @@ func Convert(d []byte, remote string) ([]byte, error) {
toContainer(container),
)
}
} else if os.Getenv("DRONE_CONVERT_YAML_LEGACY_CLONE") == "true" {
pipeline.Clone.Disable = true
pipeline.Steps = append(pipeline.Steps, &droneyaml.Container{
Name: "clone",
Image: "plugins/git",
Pull: "if-not-exists",
})
}
for _, container := range from.Services.Containers {
@ -114,8 +121,8 @@ func Convert(d []byte, remote string) ([]byte, error) {
if len(from.Branches.Include) > 0 && len(from.Branches.Exclude) == 0 {
pipeline.Trigger.Branch.Include = nil
pipeline.Trigger.Ref.Include = []string{
"refs/pull/**", // github
"refs/pull-requests/**", // bitbucket
"refs/pull/**", // github
"refs/pull-requests/**", // bitbucket
"refs/merge-requests/**", // gitlab
}
for _, branch := range from.Branches.Include {