ci: push images to public Zot over HTTPS [CI SKIP]
This commit is contained in:
1 parent
68406843de
commit
a7a8212c08
3 files changed
+18
-17
No files matched your search
+5
-5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user