mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-29 18:04:15 +02:00
read detached from yaml
This commit is contained in:
parent
538f82c898
commit
24a078beb3
@ -61,6 +61,7 @@ type container struct {
|
||||
Image string `yaml:"image"`
|
||||
Build string `yaml:"build"`
|
||||
Pull bool `yaml:"pull"`
|
||||
Detached bool `yaml:"detach"`
|
||||
Privileged bool `yaml:"privileged"`
|
||||
Environment types.MapEqualSlice `yaml:"environment"`
|
||||
Labels types.MapEqualSlice `yaml:"labels"`
|
||||
@ -131,6 +132,7 @@ func (c *containerList) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
Image: cc.Image,
|
||||
Build: cc.Build,
|
||||
Pull: cc.Pull,
|
||||
Detached: cc.Detached,
|
||||
Privileged: cc.Privileged,
|
||||
Environment: cc.Environment.Map(),
|
||||
Labels: cc.Labels.Map(),
|
||||
|
@ -27,6 +27,7 @@ func TestContainerNode(t *testing.T) {
|
||||
g.Assert(c.Image).Equal("golang")
|
||||
g.Assert(c.Build).Equal(".")
|
||||
g.Assert(c.Pull).Equal(true)
|
||||
g.Assert(c.Detached).Equal(true)
|
||||
g.Assert(c.Privileged).Equal(true)
|
||||
g.Assert(c.Entrypoint).Equal([]string{"/bin/sh"})
|
||||
g.Assert(c.Command).Equal([]string{"yes"})
|
||||
@ -69,6 +70,7 @@ foo:
|
||||
image: golang
|
||||
build: .
|
||||
pull: true
|
||||
detach: true
|
||||
privileged: true
|
||||
environment:
|
||||
FOO: BAR
|
||||
|
Loading…
x
Reference in New Issue
Block a user