Skip to content

Commit

Permalink
Only try to get image manifest digest after pushing
Browse files Browse the repository at this point in the history
Since we anyways can only sign an image which has a manifest digiest
  • Loading branch information
agners committed Aug 13, 2024
1 parent a161d0f commit 2d0a4d9
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,13 @@ function run_build() {
fi
done
done
fi

# Singing image (cosign)
image_id=$(docker inspect --format='{{index .RepoDigests 0}}' "${repository}/${image}:${version}")
cosign_sign "${image_id}"
# Singing image (cosign)
if bashio::var.true "${COSIGN}"; then
image_digest=$(docker inspect --format='{{index .RepoDigests 0}}' "${repository}/${image}:${version}")
cosign_sign "${image_digest}"
fi
fi
}

function convert_to_json() {
Expand Down Expand Up @@ -757,10 +759,6 @@ function cosign_sign() {

local success=false

if bashio::var.false "${DOCKER_PUSH}" || bashio::var.false "${COSIGN}"; then
return 0
fi

for j in {1..6}; do
if cosign sign --yes "${image}"; then
success=true
Expand Down

0 comments on commit 2d0a4d9

Please sign in to comment.