diff options
author | Jordan Petridis <jpetridis@gnome.org> | 2018-11-11 22:32:14 +0200 |
---|---|---|
committer | Jordan Petridis <jpetridis@gnome.org> | 2018-11-11 22:38:33 +0200 |
commit | 2bc69242a8208b531bd8f310ba1121ba59e0f347 (patch) | |
tree | 938de7f62bf46ae1638be3d5cfc32dfee60032fa | |
parent | 1dff74e71c125b48ba4e65be8de8976a5d9dba6f (diff) | |
download | mutter-alatiera/docker-images.tar.gz |
CI: add job to build the docker imagealatiera/docker-images
This defines a template for building docker images as well as a
job to build the fedora image thats mean to replace the one
that's currently used.
Close #381
-rw-r--r-- | .gitlab-ci.yml | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index df15a050d..f05b48c20 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,45 @@ -image: registry.gitlab.gnome.org/gnome/mutter/master:v1 - stages: + - docker-image - build build-mutter: + image: registry.gitlab.gnome.org/gnome/mutter/master:v1 stage: build script: - meson . build -Degl_device=true -Dwayland_eglstream=true - ninja -C build - ninja -C build install + +.docker base: + image: 'docker:stable' + services: + - docker:dind + script: + - export IMAGE="${CI_REGISTRY_IMAGE}/${ARCH}/${TAG}" + - export REF="${IMAGE}:${CI_COMMIT_SHA}" + - export LATEST="${IMAGE}:latest" + + - docker build --pull -t ${REF} ${CONTEXT_DIR} + - docker image tag ${REF} ${LATEST} + + # Push the images + - | + if [ "$CI_COMMIT_REF_NAME" = "master" ]; then + docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + docker push ${REF} + docker push ${LATEST} + fi + +docker fedora amd64: + extends: '.docker base' + stage: 'docker-image' + variables: + # When using dind, it's wise to use the overlayfs driver for + # improved performance. + DOCKER_DRIVER: 'overlay2' + ARCH: 'amd64' + TAG: 'fedora' + CONTEXT_DIR: '.gitlab-ci/' + only: + changes: + - '.gitlab-ci/Dockerfile' |