Stop app image signing after build failures
Homelab Main / validate (push) Waiting to run Details
Homelab Main / deploy (push) Blocked by required conditions Details

This commit is contained in:
juvenal.diaz 2026-09-26 11:53:56 -06:00
parent 0ace68506f
commit 468c2c535e
2 changed files with 24 additions and 7 deletions

View File

@ -10,8 +10,9 @@ render_page() {
request_uri="$4"
mkdir -p "$(dirname "$output")"
echo "Rendering ${source} (${lang}) -> ${output}" >&2
# shellcheck disable=SC2016
php -r '
if php -d display_errors=stderr -d log_errors=0 -r '
parse_str($argv[1], $_GET);
$_SERVER["HTTP_ACCEPT_LANGUAGE"] = $argv[2];
$_SERVER["REQUEST_METHOD"] = "GET";
@ -19,7 +20,14 @@ render_page() {
$_SERVER["PHP_SELF"] = "/" . $argv[4];
chdir($argv[5]);
include $argv[5] . "/" . $argv[4];
' "lang=$lang" "$lang" "$request_uri" "$source" "$root" > "$output"
' "lang=$lang" "$lang" "$request_uri" "$source" "$root" > "$output"; then
return 0
fi
status=$?
echo "Failed rendering ${source} (${lang}) with exit status ${status}" >&2
rm -f "$output"
return "$status"
}
for lang in en nah; do

View File

@ -3545,7 +3545,10 @@ publish_image_supply_chain_metadata() {
return 0
fi
digest_ref="$(image_digest_ref "${image_ref}")"
if ! digest_ref="$(image_digest_ref "${image_ref}")" || [[ -z "${digest_ref}" ]]; then
echo "Cannot publish supply-chain metadata because image digest resolution failed for ${image_ref}." >&2
return 1
fi
mapfile -t registry_flags < <(cosign_registry_flags "${registry_endpoint}" "${digest_ref}")
sbom_file="$(mktemp)"
write_image_sbom_predicate "${digest_ref}" "${sbom_file}" "${source_hash}"
@ -5332,7 +5335,7 @@ apps() {
buildx_builder_ready=true
fi
docker buildx build \
if ! docker buildx build \
--network host \
--platform "${website_platforms}" \
--provenance=false \
@ -5341,7 +5344,10 @@ apps() {
-t "${website_image_ref}" \
-f "${REPO_ROOT}/apps/website/Dockerfile" \
"${REPO_ROOT}/apps/website/" \
--push
--push; then
echo "Website image build failed for ${website_image_ref}; not publishing supply-chain metadata." >&2
return 1
fi
website_image_built=true
fi
publish_image_supply_chain_metadata "${website_image_ref}" "${registry_endpoint}" "${website_source_hash}"
@ -5357,7 +5363,7 @@ apps() {
buildx_builder_ready=true
fi
docker buildx build \
if ! docker buildx build \
--network host \
--platform "${demos_platforms}" \
--provenance=false \
@ -5366,7 +5372,10 @@ apps() {
-t "${demos_image_ref}" \
-f "${REPO_ROOT}/apps/demos-static/Dockerfile" \
"${REPO_ROOT}/apps/demos-static/" \
--push
--push; then
echo "Demos image build failed for ${demos_image_ref}; not publishing supply-chain metadata." >&2
return 1
fi
demos_image_built=true
fi
publish_image_supply_chain_metadata "${demos_image_ref}" "${registry_endpoint}" "${demos_source_hash}"