21 lines
621 B
Bash
21 lines
621 B
Bash
#!/usr/bin/env bash
|
|
set -Eeuo pipefail
|
|
|
|
if [[ $# -lt 2 || $# -gt 4 ]]; then
|
|
echo "Usage: $0 <acr-registry> <namespace> [repository] [tag]" >&2
|
|
exit 2
|
|
fi
|
|
|
|
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
registry="$1"
|
|
namespace="$2"
|
|
repository="${3:-mini-openclaw}"
|
|
tag="${4:-$(git -C "$root" rev-parse --short HEAD)}"
|
|
[[ "$registry" == *.aliyuncs.com ]] || { echo "ACR registry must end in .aliyuncs.com" >&2; exit 2; }
|
|
image="${registry}/${namespace}/${repository}:${tag}"
|
|
|
|
python "$root/scripts/verify.py"
|
|
docker build --pull -t "$image" "$root"
|
|
docker push "$image"
|
|
echo "Published immutable image: $image"
|