This commit is contained in:
Your Name
2024-05-19 22:41:22 +08:00
parent fdd6bfcb4e
commit ae7dd5a20a
2 changed files with 35 additions and 3 deletions

View File

@@ -2,10 +2,16 @@
USER=zerotier
REPO=ZeroTierOne
DOCKER_IMAGE="xubiaolin/zerotier-planet"
latest_tag=$(curl -s "https://api.github.com/repos/$USER/$REPO/tags" | jq -r '.[].name' | grep -E "^[0-9]+\.[0-9]+\.[0-9]+$" | sort -V | tail -n 1)
latest_docker_tag=$(curl -s "https://hub.docker.com/v2/repositories/${DOCKER_IMAGE}/tags/" | jq -r '.results[].name' | grep -E "^[0-9]+\.[0-9]+\.[0-9]+$" | sort -V | tail -n 1)
# if [ "$latest_tag" == "$latest_docker_tag" ]; then
# echo "No new version found"
# exit 0
# fi
echo "Latest tag for $USER/$REPO matching latest is: $latest_tag"
docker build --build-arg TAG="$latest_tag" -t "xubiaolin/zerotier-planet:$latest_tag" .
docker tag "xubiaolin/zerotier-planet:$latest_tag" "xubiaolin/zerotier-planet:latest"
docker buildx build --platform linux/arm64,linux/amd64 -t myimage:latest --push .