From: Yann E. MORIN Date: Sun, 6 Sep 2020 20:12:21 +0000 (+0200) Subject: gitlab-ci: share the image version with the child X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bef67390949dd6ba5cbfd658371c5df81bb5758c;p=buildroot.git gitlab-ci: share the image version with the child Currently, the image name and version are duplicated in the main pipeline and the generated, child pipeline. This is a condition for a future gaffe, so let's use the image from the main pipeline when generating the child one. Signed-off-by: Yann E. MORIN Cc: Romain Naour Cc: Thomas Petazzoni Cc: Arnout Vandecappelle Reviewed-by: Romain Naour Signed-off-by: Yann E. MORIN --- diff --git a/support/misc/gitlab-ci.yml.in b/support/misc/gitlab-ci.yml.in index 0d058bdd91..f00c764aaf 100644 --- a/support/misc/gitlab-ci.yml.in +++ b/support/misc/gitlab-ci.yml.in @@ -1,8 +1,3 @@ -# Configuration for Gitlab-CI. -# Builds appear on https://gitlab.com/buildroot.org/buildroot/pipelines - -image: buildroot/base:20200814.2228 - .check_base: rules: - if: '$CI_COMMIT_REF_NAME =~ /^.*-.*_defconfig$/ || $CI_COMMIT_REF_NAME =~ /^.*-tests\..*$/' diff --git a/support/scripts/generate-gitlab-ci-yml b/support/scripts/generate-gitlab-ci-yml index 51f7de21dd..b076b01d05 100755 --- a/support/scripts/generate-gitlab-ci-yml +++ b/support/scripts/generate-gitlab-ci-yml @@ -5,7 +5,7 @@ set -o pipefail main() { local template="${1}" - cat "${template}" + preamble "${template}" ( cd configs @@ -18,4 +18,16 @@ main() { | LC_ALL=C sort } +preamble() { + local template="${1}" + + cat - "${template}" <<-_EOF_ + # This file is generated; do not edit! + # Builds appear on https://gitlab.com/buildroot.org/buildroot/pipelines + + image: ${CI_JOB_IMAGE} + +_EOF_ +} + main "${@}"