mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-06-07 09:58:51 +00:00
Merge pull request #1876 from bradrydzewski/master
Read detach attribute from yaml
This commit is contained in:
commit
43b11ed322
2 changed files with 4 additions and 0 deletions
|
@ -61,6 +61,7 @@ type container struct {
|
||||||
Image string `yaml:"image"`
|
Image string `yaml:"image"`
|
||||||
Build string `yaml:"build"`
|
Build string `yaml:"build"`
|
||||||
Pull bool `yaml:"pull"`
|
Pull bool `yaml:"pull"`
|
||||||
|
Detached bool `yaml:"detach"`
|
||||||
Privileged bool `yaml:"privileged"`
|
Privileged bool `yaml:"privileged"`
|
||||||
Environment types.MapEqualSlice `yaml:"environment"`
|
Environment types.MapEqualSlice `yaml:"environment"`
|
||||||
Labels types.MapEqualSlice `yaml:"labels"`
|
Labels types.MapEqualSlice `yaml:"labels"`
|
||||||
|
@ -131,6 +132,7 @@ func (c *containerList) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||||
Image: cc.Image,
|
Image: cc.Image,
|
||||||
Build: cc.Build,
|
Build: cc.Build,
|
||||||
Pull: cc.Pull,
|
Pull: cc.Pull,
|
||||||
|
Detached: cc.Detached,
|
||||||
Privileged: cc.Privileged,
|
Privileged: cc.Privileged,
|
||||||
Environment: cc.Environment.Map(),
|
Environment: cc.Environment.Map(),
|
||||||
Labels: cc.Labels.Map(),
|
Labels: cc.Labels.Map(),
|
||||||
|
|
|
@ -27,6 +27,7 @@ func TestContainerNode(t *testing.T) {
|
||||||
g.Assert(c.Image).Equal("golang")
|
g.Assert(c.Image).Equal("golang")
|
||||||
g.Assert(c.Build).Equal(".")
|
g.Assert(c.Build).Equal(".")
|
||||||
g.Assert(c.Pull).Equal(true)
|
g.Assert(c.Pull).Equal(true)
|
||||||
|
g.Assert(c.Detached).Equal(true)
|
||||||
g.Assert(c.Privileged).Equal(true)
|
g.Assert(c.Privileged).Equal(true)
|
||||||
g.Assert(c.Entrypoint).Equal([]string{"/bin/sh"})
|
g.Assert(c.Entrypoint).Equal([]string{"/bin/sh"})
|
||||||
g.Assert(c.Command).Equal([]string{"yes"})
|
g.Assert(c.Command).Equal([]string{"yes"})
|
||||||
|
@ -69,6 +70,7 @@ foo:
|
||||||
image: golang
|
image: golang
|
||||||
build: .
|
build: .
|
||||||
pull: true
|
pull: true
|
||||||
|
detach: true
|
||||||
privileged: true
|
privileged: true
|
||||||
environment:
|
environment:
|
||||||
FOO: BAR
|
FOO: BAR
|
||||||
|
|
Loading…
Reference in a new issue