summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2019-02-22 15:52:08 +0000
committerEric Engestrom <[email protected]>2019-02-26 12:02:14 +0000
commit7f5d9c27579aec3eefe6a48eec5c3b25c1443439 (patch)
treecc11de032f7ef32fbc83d7b4ed3ae0f071a1f3b8
parent40a82e6463f2686b262cdb1dad067646c47d4469 (diff)
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 <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
-rw-r--r--.gitlab-ci.yml18
1 files changed, 10 insertions, 8 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9ac1be258c6..3cb16edccd0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -29,9 +29,18 @@ stages:
- build+test
+# When to automatically run the CI
+.ci-run-policy:
+ only:
+ - master
+ - merge_requests
+ - /^ci([-/].*)?$/
+
+
# CONTAINERS
containers:ubuntu:
+ extends: .ci-run-policy
stage: containers-build
image: docker:stable
services:
@@ -52,21 +61,14 @@ containers:ubuntu:
docker image push $UBUNTU_IMAGE && exit || true
- docker build -t $UBUNTU_IMAGE -f .gitlab-ci/Dockerfile.ubuntu .
- docker push $UBUNTU_IMAGE
- only:
- changes:
- - .gitlab-ci.yml
- - .gitlab-ci/Dockerfile.ubuntu
# BUILD
.build:
+ extends: .ci-run-policy
image: $UBUNTU_IMAGE
stage: build+test
- only:
- - master
- - merge_requests
- - /^ci([-/].*)?$/
artifacts:
when: on_failure
untracked: true