diff options
author | Michel Dänzer <[email protected]> | 2019-02-08 10:14:58 +0100 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2019-02-11 12:24:31 +0100 |
commit | d6c55f6c62d9907f13aa21b5b07ce25430b669ee (patch) | |
tree | 93f18e8ef8bfc08c79cd6f6b618141e674fdf4be /.gitlab-ci.yml | |
parent | cc79a1483ffb7b91edc97c9870eadcab1e83b8f3 (diff) |
gitlab-ci: Re-use docker image from the main repo in forked repos
Instead of generating it from scratch in each forked repo. This should
save time, energy and storage. (The xserver & xf86-video-amdgpu CI
scripts do basically the same)
v2:
* Hardcode "mesa" instead of using $CI_PROJECT_NAME, to avoid breakage
if the project name is changed after forking (Eric Engestrom)
Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0a097ce3830..f0e16cf1c28 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,6 +18,7 @@ variables: UBUNTU_TAG: 2019-01-31-01 UBUNTU_IMAGE: "$CI_REGISTRY_IMAGE/ubuntu:$UBUNTU_TAG" + UBUNTU_IMAGE_MAIN: "registry.freedesktop.org/mesa/mesa/ubuntu:$UBUNTU_TAG" stages: @@ -42,6 +43,10 @@ containers:ubuntu: - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY # Check if the image (with the specific tag) already exists - docker manifest inspect $UBUNTU_IMAGE && exit || true + # Try to re-use the image from the main repository's registry + - docker image pull $UBUNTU_IMAGE_MAIN && + docker image tag $UBUNTU_IMAGE_MAIN $UBUNTU_IMAGE && + docker image push $UBUNTU_IMAGE && exit || true - docker build -t $UBUNTU_IMAGE -f .gitlab-ci/Dockerfile.ubuntu . - docker push $UBUNTU_IMAGE only: |