Skip to content

Commit a5aa4af

Browse files
committed
test signing and publishing of image
1 parent e0b7446 commit a5aa4af

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

.github/workflows/image-publish.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66

77
name: Publish monitoring image to Docker Registry (on new release tag)
88
on:
9-
push:
10-
tags:
11-
# To modify to trigger the job for fork's releases
12-
# Note: GitHub's filter pattern capabilities are limited[1], so this
13-
# pattern matches more often than it should. A more correct regex would
14-
# be the one found in scripts/tag.sh.
15-
# [1] https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
16-
- "interuss/monitoring/v[0-9]+.[0-9]+.[0-9]+-?*"
9+
pull_request: # TODO: added for testing purposes, remove me before merging
10+
# TODO: commented out for testing purposes, restore me before merging
11+
# push:
12+
# tags:
13+
# # To modify to trigger the job for fork's releases
14+
# # Note: GitHub's filter pattern capabilities are limited[1], so this
15+
# # pattern matches more often than it should. A more correct regex would
16+
# # be the one found in scripts/tag.sh.
17+
# # [1] https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
18+
# - "interuss/monitoring/v[0-9]+.[0-9]+.[0-9]+-?*"
1719
permissions:
1820
contents: read
1921
jobs:
@@ -28,8 +30,6 @@ jobs:
2830
steps:
2931
- name: Install Cosign
3032
uses: sigstore/cosign-installer@cad07c2e89fa2edd6e2d7bab4c1aa38e53f76003 # v4.1.1
31-
with:
32-
cosign-release: 'v2.6.1'
3333
- name: Job information
3434
run: |
3535
echo "Job information"
@@ -56,7 +56,7 @@ jobs:
5656
- name: Build, push and sign image
5757
env:
5858
DOCKER_URL: ${{ secrets.DOCKER_URL }}
59-
DOCKER_UPDATE_LATEST: true
59+
DOCKER_UPDATE_LATEST: false # TODO: changed for testing purposes, revert me to 'true' before merging
6060
DOCKER_SIGN: true
6161
CERT_IDENTITY: https://github.com/${{ github.workflow_ref }}
6262
CERT_ISSUER: https://token.actions.githubusercontent.com

build/build_and_push.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ else
2727
fi
2828
cd "${BASEDIR}"
2929

30-
VERSION=$(./scripts/git/version.sh monitoring)
30+
VERSION=cosign-test # TODO: hardcoded for testing purposes, remove me before merging
31+
#VERSION=$(./scripts/git/version.sh monitoring)
3132
LATEST_TAG="latest"
3233

3334
if [[ -z "${DOCKER_URL}" ]]; then
@@ -50,10 +51,11 @@ else
5051
# We sign only the first digest of the image. We don't expect multiple ones as we are building for a single architecture.
5152
DIGEST=$(docker image inspect --format='{{index .RepoDigests 0}}' "${TAG}")
5253
echo "Signing docker image ${TAG} (digest: ${DIGEST})..."
53-
cosign sign --yes "${DIGEST}"
54+
cosign sign -d --yes "${DIGEST}"
55+
sleep 30
5456

55-
echo "Verifying signature of docker image ${TAG} (digest: ${DIGEST})..."
56-
cosign verify "${DIGEST}" --certificate-identity="${CERT_IDENTITY}" --certificate-oidc-issuer="${CERT_ISSUER}"
57+
echo "Verifying locally signature of docker image ${TAG} (digest: ${DIGEST})..."
58+
cosign verify -d --certificate-identity="${CERT_IDENTITY}" --certificate-oidc-issuer="${CERT_ISSUER}" "${DIGEST}"
5759

5860
echo "Signed and verified signature of docker image ${TAG} (digest: ${DIGEST})..."
5961

0 commit comments

Comments
 (0)