diff options
author | Thomas Haller <thaller@redhat.com> | 2020-11-17 09:21:12 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-11-17 09:40:35 +0100 |
commit | 539c00a8a158691347514e10947adee622bc4042 (patch) | |
tree | f402269f6e8c6473bcb89a210ac21d710f53e287 /.gitlab-ci/ci.template | |
parent | 71c3291296ed9441899aac32d4e959a078484904 (diff) | |
download | NetworkManager-539c00a8a158691347514e10947adee622bc4042.tar.gz |
gitlab-ci: automatically hash build scripts into tag for ci-templates container
ci-templates builds and caches the test containers. When the build
scripts, the ci-template or "config.yml" changes, we need to bump
the tag so that the containers get rebuild.
Partly automate this. The tag now gets generated by the template and
contains a checksum of certain build files. Thus, if you change
any build files, then `ci-fairy generate-template` would generate a
different tag. You can not miss that, because we have tests that ensure
that our ".gitlab-ci.yml" is up to date. Also, you no longer need to
manually bump the tag when a build script changes, just regenerate
".gitlab-ci.yml" with `ci-fairy generate-template`.
See also: https://gitlab.freedesktop.org/freedesktop/ci-templates/-/merge_requests/54
Diffstat (limited to '.gitlab-ci/ci.template')
-rw-r--r-- | .gitlab-ci/ci.template | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index 7208aac299..229ba16d81 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -9,7 +9,7 @@ ######################################## -.templates_sha: &template_sha d303fafa66bbca44cc5bdb337d5773b5f019b70d # see https://docs.gitlab.com/ee/ci/yaml/#includefile +.templates_sha: &template_sha 766e3d77c647e404b349e398427e8965a1769b64 # see https://docs.gitlab.com/ee/ci/yaml/#includefile include: {% for distro in distributions|sort(attribute="name") %} @@ -34,7 +34,12 @@ variables: # Note: these tags have no meaning and are not tied to a particular # libinput version {% for distro in distributions %} - {{"%-13s"| format(distro.name.upper() + '_TAG:')}}'{{distro.tag}}' + {{"%-13s"| format(distro.name.upper() + '_TAG:')}}'{{distro.tag}}-{{ + (ci_fairy.hashfiles('./.gitlab-ci/config.yml', + './.gitlab-ci/ci.template', + './.gitlab-ci/' + distro.name + '-install.sh', + './contrib/' + distro.base_type + '/REQUIRED_PACKAGES'))[0:12] + }}' {% endfor %} {% for distro in distributions %} |