drone-yaml/yaml/compiler/transform/network.go

15 lines
387 B
Go
Raw Normal View History

2019-01-22 23:44:17 +00:00
package transform
import "github.com/drone/drone-runtime/engine"
// WithNetworks is a transform function that attaches a
// list of user-defined Docker networks to each step.
func WithNetworks(networks []string) func(*engine.Spec) {
return func(spec *engine.Spec) {
for _, step := range spec.Steps {
step.Docker.Networks = append(
step.Docker.Networks, networks...)
}
}
}