forked from xubiaolin/docker-zerotier-planet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·18 lines (13 loc) · 766 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·18 lines (13 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
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 buildx build --platform linux/arm64,linux/amd64 -t "$DOCKER_IMAGE":latest --push .
docker buildx build --platform linux/arm64,linux/amd64 -t "${DOCKER_IMAGE}:${latest_tag}" --push .