mirror of
https://github.com/prometheus-operator/prometheus-operator.git
synced 2025-04-21 03:38:43 +00:00
Merge pull request #5393 from simonpasquier/fix-push-script4
scripts/push-docker-image.sh: add amend option for main tag
This commit is contained in:
commit
1e0a95e9b7
2 changed files with 8 additions and 1 deletions
2
.github/workflows/publish.yaml
vendored
2
.github/workflows/publish.yaml
vendored
|
@ -25,6 +25,8 @@ jobs:
|
|||
go-version: '${{ env.golang-version }}'
|
||||
- name: Install cosign
|
||||
uses: sigstore/cosign-installer@main
|
||||
- name: Check the Docker version
|
||||
run: docker version
|
||||
- name: Check the cosign version
|
||||
run: cosign version
|
||||
- name: Install crane
|
||||
|
|
|
@ -94,7 +94,8 @@ for r in ${OPERATORS} ${RELOADERS} ${WEBHOOKS}; do
|
|||
done
|
||||
|
||||
# Create the manifest to join all images under one virtual tag.
|
||||
docker manifest create "${MANIFEST}" "${IMAGES[@]}"
|
||||
echo "Creating manifest ${MANIFEST}"
|
||||
docker manifest create --amend "${MANIFEST}" "${IMAGES[@]}"
|
||||
|
||||
# Annotate to set which image is build for which CPU architecture.
|
||||
for arch in $CPU_ARCHS; do
|
||||
|
@ -102,11 +103,15 @@ for r in ${OPERATORS} ${RELOADERS} ${WEBHOOKS}; do
|
|||
done
|
||||
|
||||
# Push the manifest to the remote registry.
|
||||
echo "Pushing manifest ${MANIFEST}"
|
||||
docker manifest push "${MANIFEST}"
|
||||
|
||||
# Sign the manifest for official tags.
|
||||
if [[ -z "${MAIN_BRANCH}" ]]; then
|
||||
DIGEST="$(crane digest "${MANIFEST}")"
|
||||
echo "Signing manifest ${MANIFEST}@${DIGEST}"
|
||||
cosign sign --yes -a GIT_HASH="${COMMIT_SHA}" -a GIT_VERSION="${TAG}" "${MANIFEST}@${DIGEST}"
|
||||
else
|
||||
echo "Not signing the manifest because the tag is 'main'"
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue