Deploy IFT: bootstrap-build aux images when :ift tag is missing.
CI / test (push) Successful in 11m1s
CI / test (push) Successful in 11m1s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7,6 +7,21 @@ REGISTRY="${1:?registry}"
|
|||||||
TAG="${2:?sha-tag}"
|
TAG="${2:?sha-tag}"
|
||||||
FILES="${3:-}"
|
FILES="${3:-}"
|
||||||
|
|
||||||
|
rebuild_image() {
|
||||||
|
local name="$1"
|
||||||
|
local context="$2"
|
||||||
|
local dockerfile="$3"
|
||||||
|
local reason="$4"
|
||||||
|
|
||||||
|
echo "== ${name}: rebuild (${reason})"
|
||||||
|
bash scripts/retry-docker-build.sh 3 30 -- \
|
||||||
|
docker buildx build -f "${dockerfile}" --push \
|
||||||
|
-t "${REGISTRY}/${name}:${TAG}" \
|
||||||
|
-t "${REGISTRY}/${name}:ift" \
|
||||||
|
--provenance=false --sbom=false \
|
||||||
|
"${context}"
|
||||||
|
}
|
||||||
|
|
||||||
publish_image() {
|
publish_image() {
|
||||||
local name="$1"
|
local name="$1"
|
||||||
local path_pattern="$2"
|
local path_pattern="$2"
|
||||||
@@ -19,20 +34,14 @@ publish_image() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if echo "${FILES}" | grep -qE "${path_pattern}"; then
|
if echo "${FILES}" | grep -qE "${path_pattern}"; then
|
||||||
echo "== ${name}: rebuild (matched: ${path_pattern})"
|
rebuild_image "${name}" "${context}" "${dockerfile}" "matched: ${path_pattern}"
|
||||||
bash scripts/retry-docker-build.sh 3 30 -- \
|
|
||||||
docker buildx build -f "${dockerfile}" --push \
|
|
||||||
-t "${REGISTRY}/${name}:${TAG}" \
|
|
||||||
-t "${REGISTRY}/${name}:ift" \
|
|
||||||
--provenance=false --sbom=false \
|
|
||||||
"${context}"
|
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "== ${name}: unchanged, promote :ift -> ${TAG}"
|
echo "== ${name}: unchanged, promote :ift -> ${TAG}"
|
||||||
if ! docker buildx imagetools inspect "${REGISTRY}/${name}:ift" >/dev/null 2>&1; then
|
if ! docker buildx imagetools inspect "${REGISTRY}/${name}:ift" >/dev/null 2>&1; then
|
||||||
echo "ERROR: ${name}:ift not found and no matching changes in this commit"
|
rebuild_image "${name}" "${context}" "${dockerfile}" "bootstrap: :ift not found"
|
||||||
exit 1
|
return
|
||||||
fi
|
fi
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
-t "${REGISTRY}/${name}:${TAG}" \
|
-t "${REGISTRY}/${name}:${TAG}" \
|
||||||
|
|||||||
Reference in New Issue
Block a user