+# Build the CI docker images.
+#
+# FDO_DISTRIBUTION_TAG is the tag of the docker image used by later stage jobs. If the
+# image doesn't exist yet, the container stage job generates it.
+#
+# In order to generate a new image, one should generally change the tag.
+# While removing the image from the registry would also work, that's not
+# recommended except for ephemeral images during development: Replacing
+# an image after a significant amount of time might pull in newer
+# versions of gcc/clang or other packages, which might break the build
+# with older commits using the same tag.
+#
+# After merging a change resulting in generating a new image to the
+# 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.
+
+.container:
+ stage: container
+ extends:
+ - .ci-run-policy
+ rules:
+ # Run pipeline by default if it was triggered by Marge Bot, is for a
+ # merge request, and any files affecting it were changed
+ - if: '$GITLAB_USER_LOGIN == "marge-bot" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
+ changes:
+ *all_paths
+ when: on_success
+ # Run pipeline by default in the main project if any files affecting it were
+ # changed
+ - if: '$CI_PROJECT_PATH == "mesa/mesa"'
+ changes:
+ *all_paths
+ when: on_success
+ # Allow triggering jobs manually for MRs or branches of forked projects if
+ # any files affecting the pipeline were changed
+ - changes:
+ *all_paths
+ when: manual
+ # Otherwise, container jobs won't run
+ - when: never
+ variables:
+ FDO_DISTRIBUTION_VERSION: buster-slim
+ FDO_REPO_SUFFIX: "debian/$CI_JOB_NAME"
+ FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
+ # no need to pull the whole repo to build the container image
+ GIT_STRATEGY: none
+
+# Debian 10 based x86 build image
+x86_build:
+ extends:
+ - .fdo.container-build@debian
+ - .container
+ variables:
+ FDO_DISTRIBUTION_TAG: &x86_build "2020-03-18-jflags"
+
+.use-x86_build:
+ variables:
+ TAG: *x86_build
+ image: "$CI_REGISTRY_IMAGE/debian/x86_build:$TAG"
+ needs:
+ - x86_build
+
+# Debian 10 based x86 test image for GL
+x86_test-gl:
+ extends: x86_build
+ variables:
+ FDO_DISTRIBUTION_TAG: &x86_test-gl "2020-03-18-jflags"
+
+# Debian 10 based x86 test image for VK
+x86_test-vk:
+ extends: x86_build
+ variables:
+ FDO_DISTRIBUTION_TAG: &x86_test-vk "2020-04-01-jflags"
+
+# Debian 9 based x86 build image (old LLVM)
+x86_build_old:
+ extends: x86_build
+ variables:
+ FDO_DISTRIBUTION_TAG: &x86_build_old "2019-03-18-jflags"
+ FDO_DISTRIBUTION_VERSION: stretch-slim
+
+.use-x86_build_old:
+ variables:
+ TAG: *x86_build_old
+ image: "$CI_REGISTRY_IMAGE/debian/x86_build_old:$TAG"
+ needs:
+ - x86_build_old