ci: push images to public Zot over HTTPS [CI SKIP]

This commit is contained in:
justme committed 2026-10-05 16:28:15 +08:00
1 parent 68406843de
commit a7a8212c08
3 files changed
+18 -17

No files matched your search

+3 -3
View File
@@ -9,13 +9,13 @@ version="${CI_COMMIT_TAG#v}"
exit 2
}
registry="${ZOT_REGISTRY:-192.168.2.162:5000}"
scheme="${ZOT_SCHEME:-http}"
registry="${ZOT_REGISTRY:-registry.oeo.one}"
scheme="${ZOT_SCHEME:-https}"
image="monitor/monitor-backend"
auth_file="$(mktemp)"
chmod 600 "$auth_file"
trap 'rm -f "$auth_file"' EXIT
printf 'machine %s login %s password %s\n' "${registry%%:*}" "$ZOT_USERNAME" "$ZOT_PASSWORD" > "$auth_file"
printf 'machine %s login %s password %s\n' "${registry%%:*}" "$ZOT_USERNAME" "$ZOT_SECRET" > "$auth_file"
accept='application/vnd.oci.image.manifest.v1+json, application/vnd.docker.distribution.manifest.v2+json, application/vnd.oci.image.index.v1+json, application/vnd.docker.distribution.manifest.list.v2+json'
+5 -5
View File
@@ -9,7 +9,7 @@ tag="${CI_COMMIT_TAG:-}"
echo "release must run from a vMAJOR.MINOR.PATCH tag" >&2
exit 2
}
[[ -n "${ZOT_USERNAME:-}" && -n "${ZOT_PASSWORD:-}" ]] || {
[[ -n "${ZOT_USERNAME:-}" && -n "${ZOT_SECRET:-}" ]] || {
echo "Zot credentials are required" >&2; exit 2;
}
case "$arch" in
@@ -24,7 +24,7 @@ if [[ "$version" != "$project_version" ]]; then
exit 1
fi
registry="${ZOT_REGISTRY:-192.168.2.162:5000}"
registry="${ZOT_REGISTRY:-registry.oeo.one}"
image="$registry/monitor/monitor-backend"
output="$root/.release/linux-$arch/backend"
build_root="$root/.release/build/linux-$arch-backend"
@@ -44,7 +44,7 @@ export REGISTRY_AUTH_FILE="$root/.release/auth/zot-linux-$arch.json"
mkdir -p "$(dirname "$REGISTRY_AUTH_FILE")"
logged_in=false
for attempt in 1 2 3 4; do
if buildah login --tls-verify=false --username "$ZOT_USERNAME" --password-stdin "$registry" <<< "$ZOT_PASSWORD" >/dev/null; then
if buildah login --tls-verify=true --username "$ZOT_USERNAME" --password-stdin "$registry" <<< "$ZOT_SECRET" >/dev/null; then
logged_in=true
break
fi
@@ -55,13 +55,13 @@ for attempt in 1 2 3 4; do
done
[[ "$logged_in" == true ]] || { echo "could not authenticate to Zot after 4 attempts" >&2; exit 1; }
local_image="localhost/monitor-backend:$version-$arch"
buildah bud --tls-verify=false --arch "$arch" \
buildah bud --tls-verify=true --arch "$arch" \
--build-arg "APP_VERSION=$version" \
-f "$root/packaging/container/Backend.Containerfile" \
-t "$local_image" "$container_context" >/dev/null
pushed=false
for attempt in 1 2 3; do
if buildah push --tls-verify=false "$local_image" "docker://$image:$version-$arch" >/dev/null; then
if buildah push --tls-verify=true "$local_image" "docker://$image:$version-$arch" >/dev/null; then
pushed=true
break
fi