build dependent service images when required
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
693b9ef078
commit
f4fc010d6b
@ -261,6 +261,7 @@ func runUp(
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
bo.Services = services
|
bo.Services = services
|
||||||
|
bo.Deps = !upOptions.noDeps
|
||||||
build = &bo
|
build = &bo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -524,3 +524,15 @@ func TestBuildEntitlements(t *testing.T) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestBuildDependsOn(t *testing.T) {
|
||||||
|
c := NewParallelCLI(t)
|
||||||
|
|
||||||
|
t.Cleanup(func() {
|
||||||
|
c.RunDockerComposeCmd(t, "-f", "fixtures/build-dependencies/compose-depends_on.yaml", "down", "--rmi=local")
|
||||||
|
})
|
||||||
|
|
||||||
|
res := c.RunDockerComposeCmd(t, "-f", "fixtures/build-dependencies/compose-depends_on.yaml", "--progress=plain", "up", "test2")
|
||||||
|
out := res.Combined()
|
||||||
|
assert.Check(t, strings.Contains(out, "test1 Built"))
|
||||||
|
}
|
||||||
|
15
pkg/e2e/fixtures/build-dependencies/compose-depends_on.yaml
Normal file
15
pkg/e2e/fixtures/build-dependencies/compose-depends_on.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
services:
|
||||||
|
test1:
|
||||||
|
pull_policy: build
|
||||||
|
build:
|
||||||
|
dockerfile_inline: FROM alpine
|
||||||
|
command:
|
||||||
|
- echo
|
||||||
|
- "test 1 success"
|
||||||
|
test2:
|
||||||
|
image: alpine
|
||||||
|
depends_on:
|
||||||
|
- test1
|
||||||
|
command:
|
||||||
|
- echo
|
||||||
|
- "test 2 success"
|
Loading…
x
Reference in New Issue
Block a user