gitlab-ci: always run the containers build
If the first time a fork was created, the job creating the containers was manually cancelled, this would have left the fork unable to use the CI (until the next automatic regeneration of the container). Avoid this by always running the container-generation job, even though 99% of the time it will spin up, see that the container exists and shut down. Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
@@ -29,9 +29,18 @@ stages:
|
|||||||
- build+test
|
- build+test
|
||||||
|
|
||||||
|
|
||||||
|
# When to automatically run the CI
|
||||||
|
.ci-run-policy:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
- merge_requests
|
||||||
|
- /^ci([-/].*)?$/
|
||||||
|
|
||||||
|
|
||||||
# CONTAINERS
|
# CONTAINERS
|
||||||
|
|
||||||
containers:ubuntu:
|
containers:ubuntu:
|
||||||
|
extends: .ci-run-policy
|
||||||
stage: containers-build
|
stage: containers-build
|
||||||
image: docker:stable
|
image: docker:stable
|
||||||
services:
|
services:
|
||||||
@@ -52,21 +61,14 @@ containers:ubuntu:
|
|||||||
docker image push $UBUNTU_IMAGE && exit || true
|
docker image push $UBUNTU_IMAGE && exit || true
|
||||||
- docker build -t $UBUNTU_IMAGE -f .gitlab-ci/Dockerfile.ubuntu .
|
- docker build -t $UBUNTU_IMAGE -f .gitlab-ci/Dockerfile.ubuntu .
|
||||||
- docker push $UBUNTU_IMAGE
|
- docker push $UBUNTU_IMAGE
|
||||||
only:
|
|
||||||
changes:
|
|
||||||
- .gitlab-ci.yml
|
|
||||||
- .gitlab-ci/Dockerfile.ubuntu
|
|
||||||
|
|
||||||
|
|
||||||
# BUILD
|
# BUILD
|
||||||
|
|
||||||
.build:
|
.build:
|
||||||
|
extends: .ci-run-policy
|
||||||
image: $UBUNTU_IMAGE
|
image: $UBUNTU_IMAGE
|
||||||
stage: build+test
|
stage: build+test
|
||||||
only:
|
|
||||||
- master
|
|
||||||
- merge_requests
|
|
||||||
- /^ci([-/].*)?$/
|
|
||||||
artifacts:
|
artifacts:
|
||||||
when: on_failure
|
when: on_failure
|
||||||
untracked: true
|
untracked: true
|
||||||
|
Reference in New Issue
Block a user