mirror of
https://github.com/thegeeklab/drone-yaml.git
synced 2024-11-05 19:10:38 +00:00
15 lines
387 B
Go
15 lines
387 B
Go
|
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...)
|
||
|
}
|
||
|
}
|
||
|
}
|