Skip to content

Commit b1d355f

Browse files
eb-ossGerrit Code Review
authored andcommitted
Merge "Fix: Adapt release script for -e mode"
2 parents d4c7259 + f4db025 commit b1d355f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

shell/release-job.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,17 +440,17 @@ container_release_file(){
440440
echo "INFO: $VERSION is already released for image $name, checking signature..."
441441
image_digest=$(docker inspect --format='{{index .RepoDigests 0}}' \
442442
"$CONTAINER_PUSH_REGISTRY"/"$lfn_umbrella"/"$name":"$VERSION")
443-
cosign verify --key "$COSIGN_PUBLIC_KEY" "$image_digest"
444-
cosign_verified=$?
445-
if [ "$cosign_verified" -eq 0 ]; then
443+
exit_code=0
444+
cosign verify --key "$COSIGN_PUBLIC_KEY" "$image_digest" || exit_code=$?
445+
if [ "$exit_code" -eq 0 ]; then
446446
echo "INFO: $name:$VERSION is already signed, continuing..."
447-
elif [ "$cosign_verified" -eq 10 ] && [[ "$JOB_NAME" =~ "merge" ]]; then
447+
elif [ "$exit_code" -eq 10 ] && [[ "$JOB_NAME" =~ "merge" ]]; then
448448
# Exit code 10 indicates the package was found without signature
449449
echo "INFO: No signature found for $name:$VERSION. Attempting to sign..."
450450
export COSIGN_PASSWORD
451451
cosign sign -y --key "$COSIGN_PRIVATE_KEY" "$image_digest"
452452
else
453-
echo "INFO: Could not verify signature, cosign exited with code $cosign_verified."
453+
echo "INFO: Could not verify signature, cosign exited with code $exit_code."
454454
fi
455455
else
456456
echo "INFO: $VERSION not found in releases, release will be prepared. Continuing..."

0 commit comments

Comments
 (0)