Commit 6324102b authored by Rohan Garg's avatar Rohan Garg Committed by Alexandros Frantzis

gitlab-ci: Organize images using new REPO_SUFFIX templates feature

Two benefits:

Most docker image related environment variables can now be defined in
the jobs where they're used instead of globally. The DEBIAN_TAG values
are propagated to other jobs via YAML anchors.

Images in the gitlab container registry are now organized in separate
repositories with a suffix matching the name of the job which makes sure
the image is there.
Signed-off-by: default avatarRohan Garg <rohan.garg@collabora.com>
Signed-off-by: Alexandros Frantzis's avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
parent 23513aeb
Pipeline #80967 failed with stages
in 12 minutes and 25 seconds
......@@ -12,19 +12,13 @@
# main repository, it's recommended to remove the image from the source
# repository's container registry, so that the image from the main
# repository's registry will be used there as well.
variables:
# UPSTREAM_REPO: mesa/mesa
DEBIAN_TAG: "2019-10-30"
DEBIAN_VERSION: buster-slim
DEBIAN_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
include:
- project: 'wayland/ci-templates'
ref: c73dae8b84697ef18e2dbbf4fed7386d9652b0cd
ref: f69acac60d5dde0410124fd5674764600821b7a6
file: '/templates/debian.yml'
stages:
- containers-build
- container
- build
- test
......@@ -41,20 +35,39 @@ stages:
# CONTAINERS
debian:
extends: .debian@container-ifnot-exists
stage: containers-build
<<: *ci-run-policy
.container:
stage: container
extends:
- .ci-run-policy
variables:
GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh'
DEBIAN_VERSION: buster-slim
REPO_SUFFIX: $CI_JOB_NAME
DEBIAN_EXEC: 'bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
# no need to pull the whole repo to build the container image
GIT_STRATEGY: none
artifacts:
when: always
# Debian 10 based x86 build image
x86_build:
extends:
- .debian@container-ifnot-exists
- .container
variables:
DEBIAN_TAG: &x86_build "2019-11-13"
.use-x86_build:
variables:
TAG: *x86_build
image: "$CI_REGISTRY_IMAGE/debian/x86_build:$TAG"
needs:
- x86_build
# MESA BUILD
mesa-build:
image: $DEBIAN_IMAGE
extends:
- .use-x86_build
stage: build
variables:
UNWIND: "true"
......@@ -104,13 +117,14 @@ mesa-build:
# TESTING
.conformance-base:
image: $DEBIAN_IMAGE
stage: test
dependencies:
- mesa-build
variables:
TRACES_DB_REPO: "https://gitlab.freedesktop.org/gfx-ci/tracie/traces-db"
TRACES_DB_COMMIT: "master"
TAG: *x86_build
image: "$CI_REGISTRY_IMAGE/debian/x86_build:$TAG"
stage: test
dependencies:
- mesa-build
before_script:
- git clone "$TRACES_DB_REPO" traces-db
- (cd traces-db; git checkout "$TRACES_DB_COMMIT")
......
......@@ -49,7 +49,7 @@ apt-get update
# Download and run upstream Mesa debian-install.sh to install all dependencies
# for building Mesa
TMPDIR=$(mktemp -d)
wget -O "$TMPDIR/debian-install.sh" 'https://gitlab.freedesktop.org/mesa/mesa/raw/master/.gitlab-ci/debian-install.sh?inline=false'
wget -O "$TMPDIR/debian-install.sh" "https://gitlab.freedesktop.org/mesa/mesa/raw/master/.gitlab-ci/container/x86_build.sh?inline=false"
bash "$TMPDIR/debian-install.sh"
rm -rf "$TMPDIR"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment