CI: use wayland-ci-templates to manage the images

There shouldn't be a difference for users, but this way we do manage
all of our containers from freedesktop.org

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
Benjamin Tissoires 2019-03-18 11:09:29 +01:00 • committed by Michel Dänzer
commit f706972309
3 changed files with 50 additions and 64 deletions

View file

@ -1,4 +1,4 @@
# IMAGE_TAG is the tag of the docker image used for the build jobs. If the
# DEBIAN_TAG is the tag of the docker image used for the build jobs. If the
# image doesn't exist yet, the docker-image stage generates it.
#
# In order to generate a new image, one should generally change the tag.
@ -13,40 +13,25 @@
# container registry, so that the image from the main repository's registry
# will be used there as well.
variables:
IMAGE_TAG: "debian-testing-20190219"
IMAGE_LOCAL: "$CI_REGISTRY_IMAGE:$IMAGE_TAG"
IMAGE_MAIN: "registry.freedesktop.org/xorg/xserver:$IMAGE_TAG"
UPSTREAM_REPO: xorg/xserver
DEBIAN_VERSION: testing-slim
DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh'
DEBIAN_TAG: "2019-03-27"
IMAGE_LOCAL: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
include:
- project: 'wayland/ci-templates'
ref: c73dae8b84697ef18e2dbbf4fed7386d9652b0cd
file: '/templates/debian.yml'
stages:
- docker-image
- build-and-test
debian-testing:
stage: docker-image
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- mkdir kaniko-context
- |
echo "FROM $IMAGE_LOCAL" > kaniko-context/Dockerfile
# If the image exists in the local registry, skip to the build-and-test job
set +e
set -x
/kaniko/executor --context kaniko-context --no-push && exit 0
set +x
set -e
- |
echo "FROM $IMAGE_MAIN" > kaniko-context/Dockerfile
# Try to re-use the image from the main repository's registry, and if
# that fails, generate a local image from scratch
set +e
set -x
/kaniko/executor --context kaniko-context --destination $IMAGE_LOCAL && exit 0
set +x
set -e
- /kaniko/executor --context $CI_PROJECT_DIR/.gitlab-ci --destination $IMAGE_LOCAL
extends: .debian@container-ifnot-exists
stage: docker-image
.common-build-and-test:
stage: build-and-test