woodpecker/yaml/transform/volume.go

21 lines
416 B
Go
Raw Normal View History

2016-05-09 18:28:49 +00:00
package transform
import "github.com/drone/drone/yaml"
func ImageVolume(conf *yaml.Config, volumes []string) error {
if len(volumes) == 0 {
return nil
}
var containers []*yaml.Container
containers = append(containers, conf.Pipeline...)
containers = append(containers, conf.Services...)
for _, container := range containers {
container.Volumes = append(container.Volumes, volumes...)
}
return nil
}