mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 20:01:02 +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"`
|
||||
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…
Reference in a new issue