diff options
author | Daniel P. Berrangé <berrange@redhat.com> | 2023-02-21 17:48:50 +0000 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2023-02-22 15:25:58 +0000 |
commit | 6e3c5ccac77714be70c0dc52c5210c7cda8fe40f (patch) | |
tree | 3d1a8fb71aadb9c466225b59466be8b9de7f0dc6 | |
parent | fd0b464e3441f778a8fd977501ceeb4e98bc99f0 (diff) | |
download | libvirt-ci-6e3c5ccac77714be70c0dc52c5210c7cda8fe40f.zip libvirt-ci-6e3c5ccac77714be70c0dc52c5210c7cda8fe40f.tar.gz libvirt-ci-6e3c5ccac77714be70c0dc52c5210c7cda8fe40f.tar.bz2 |
containers: publish to 'latest' tag instead of 'master'
Historically we use the CI_COMMIT_REF_SLUG for the docker tag, which is
the branch name. This meant that when testing container builds from
non-default tags/branches we didn't pollute the primary published
content.
When we switched to use merge requests for triggering CI in:
commit 7a7402d259db6e75b2a6fbb1523b42a2d18fabfa
Author: Daniel P. Berrangé <berrange@redhat.com>
Date: Thu Feb 10 17:43:56 2022 +0000
gitlab: switch to trigger jobs against the merge request by default
we stopped publishing containers for anything except a push to the
default branch. As such there's no reason to use CI_COMMIT_REF_SLUG,
we can just use a fixed tag name.
The docker default is to use ':latest', so adopt that instead of
':master'.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
-rw-r--r-- | .gitlab-ci.yml | 4 | ||||
-rw-r--r-- | containers/black/README.rst | 2 | ||||
-rw-r--r-- | containers/cargo-fmt/README.rst | 2 | ||||
-rw-r--r-- | containers/clang-format/README.rst | 2 | ||||
-rw-r--r-- | containers/flake8/README.rst | 2 | ||||
-rw-r--r-- | containers/go-fmt/README.rst | 2 | ||||
-rw-r--r-- | lcitool/gitlab.py | 6 | ||||
-rw-r--r-- | tests/data/manifest/out/ci/gitlab/build-templates.yml | 2 | ||||
-rw-r--r-- | tests/data/manifest/out/ci/gitlab/sanity-checks.yml | 4 |
9 files changed, 13 insertions, 13 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 619dcd5..86cc68b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,11 +42,11 @@ stages: - docker info - docker login registry.gitlab.com -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} script: - - docker build --tag ${CI_REGISTRY_IMAGE}/${NAME}:${CI_COMMIT_REF_SLUG} containers/${NAME} + - docker build --tag ${CI_REGISTRY_IMAGE}/${NAME}:latest containers/${NAME} - if test "${CI_PIPELINE_SOURCE}" = "push" && test "${CI_COMMIT_REF_NAME}" = "${CI_DEFAULT_BRANCH}"; then - docker push ${CI_REGISTRY_IMAGE}/${NAME}:${CI_COMMIT_REF_SLUG}; + docker push ${CI_REGISTRY_IMAGE}/${NAME}:latest; fi after_script: - docker logout diff --git a/containers/black/README.rst b/containers/black/README.rst index 2de2d0d..61d6d20 100644 --- a/containers/black/README.rst +++ b/containers/black/README.rst @@ -18,7 +18,7 @@ or adding the following snippet to ``.gitlab-ci.yml`` black: stage: sanity_checks - image: registry.gitlab.com/libvirt/libvirt-ci/black:master + image: registry.gitlab.com/libvirt/libvirt-ci/black:latest needs: [] script: - /black diff --git a/containers/cargo-fmt/README.rst b/containers/cargo-fmt/README.rst index 9bffeb1..c2ca802 100644 --- a/containers/cargo-fmt/README.rst +++ b/containers/cargo-fmt/README.rst @@ -18,7 +18,7 @@ or adding the following snippet to ``.gitlab-ci.yml`` cargo-fmt: stage: sanity_checks - image: registry.gitlab.com/libvirt/libvirt-ci/cargo-fmt:master + image: registry.gitlab.com/libvirt/libvirt-ci/cargo-fmt:latest needs: [] script: - /cargo-fmt diff --git a/containers/clang-format/README.rst b/containers/clang-format/README.rst index 8f20ddb..88daf17 100644 --- a/containers/clang-format/README.rst +++ b/containers/clang-format/README.rst @@ -18,7 +18,7 @@ or adding the following snippet to ``.gitlab-ci.yml`` clang-format: stage: sanity_checks - image: registry.gitlab.com/libvirt/libvirt-ci/clang-format:master + image: registry.gitlab.com/libvirt/libvirt-ci/clang-format:latest needs: [] script: - /clang-format diff --git a/containers/flake8/README.rst b/containers/flake8/README.rst index d4b4461..22a6256 100644 --- a/containers/flake8/README.rst +++ b/containers/flake8/README.rst @@ -18,7 +18,7 @@ or adding the following snippet to ``.gitlab-ci.yml`` flake8: stage: sanity_checks - image: registry.gitlab.com/libvirt/libvirt-ci/flake8:master + image: registry.gitlab.com/libvirt/libvirt-ci/flake8:latest needs: [] script: - /flake8 diff --git a/containers/go-fmt/README.rst b/containers/go-fmt/README.rst index 0af6998..132c776 100644 --- a/containers/go-fmt/README.rst +++ b/containers/go-fmt/README.rst @@ -10,7 +10,7 @@ the following snippet to ``.gitlab-ci.yml`` go-fmt: stage: prebuild - image: registry.gitlab.com/libvirt/libvirt-ci/go-fmt:master + image: registry.gitlab.com/libvirt/libvirt-ci/go-fmt:latest script: - /go-fmt artifacts: diff --git a/lcitool/gitlab.py b/lcitool/gitlab.py index ccc0b54..1b34572 100644 --- a/lcitool/gitlab.py +++ b/lcitool/gitlab.py @@ -306,7 +306,7 @@ def cirrus_template(cidir): f""" .cirrus_build_job: stage: builds - image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:master + image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:latest interruptible: true needs: [] script: @@ -371,7 +371,7 @@ def check_dco_job(): check-dco: stage: sanity_checks needs: [] - image: registry.gitlab.com/libvirt/libvirt-ci/check-dco:master + image: registry.gitlab.com/libvirt/libvirt-ci/check-dco:latest interruptible: true script: - /check-dco "$RUN_UPSTREAM_NAMESPACE" @@ -394,7 +394,7 @@ def code_fmt_template(): """ .code_format: stage: sanity_checks - image: registry.gitlab.com/libvirt/libvirt-ci/$NAME:master + image: registry.gitlab.com/libvirt/libvirt-ci/$NAME:latest interruptible: true needs: [] script: diff --git a/tests/data/manifest/out/ci/gitlab/build-templates.yml b/tests/data/manifest/out/ci/gitlab/build-templates.yml index 5d6d008..377c055 100644 --- a/tests/data/manifest/out/ci/gitlab/build-templates.yml +++ b/tests/data/manifest/out/ci/gitlab/build-templates.yml @@ -228,7 +228,7 @@ .cirrus_build_job: stage: builds - image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:master + image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:latest interruptible: true needs: [] script: diff --git a/tests/data/manifest/out/ci/gitlab/sanity-checks.yml b/tests/data/manifest/out/ci/gitlab/sanity-checks.yml index 00edbce..b26d4b1 100644 --- a/tests/data/manifest/out/ci/gitlab/sanity-checks.yml +++ b/tests/data/manifest/out/ci/gitlab/sanity-checks.yml @@ -1,7 +1,7 @@ check-dco: stage: sanity_checks needs: [] - image: registry.gitlab.com/libvirt/libvirt-ci/check-dco:master + image: registry.gitlab.com/libvirt/libvirt-ci/check-dco:latest interruptible: true script: - /check-dco "$RUN_UPSTREAM_NAMESPACE" @@ -22,7 +22,7 @@ check-dco: .code_format: stage: sanity_checks - image: registry.gitlab.com/libvirt/libvirt-ci/$NAME:master + image: registry.gitlab.com/libvirt/libvirt-ci/$NAME:latest interruptible: true needs: [] script: |