Skip to content

Commit 6be3c1d

Browse files
Improve release script
1 parent afe0f1a commit 6be3c1d

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

release-version.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,17 @@ git checkout master
77
git pull origin master
88

99
version=$(cat VERSION)
10-
echo "version: $version"
10+
echo "Version: $version"
1111

12-
# exit if tag already exists.
13-
if [ $(git tag -l "$version") ]; then
14-
echo "tag already exists. Ensure version number has been update in VERSION."
12+
# check version is in the correct format.
13+
if ! [[ "$version" =~ ^v[0-9.]+$ ]]; then
14+
echo "Version ($version) is in the wrong format."
1515
exit 1
1616
fi
1717

18-
# check version is in the correct format.
19-
if ! [[ "$version" =~ ^[0-9.]+$ ]]; then
20-
echo "version: "$version" is in the wrong format."
21-
exit 1
18+
if docker manifest inspect githubexporter/github-exporter:$version > /dev/null 2>&1; then
19+
echo "Image for version ($version) already exists on the registry. Skipping build."
20+
exit 1
2221
fi
2322

24-
docker buildx build --platform linux/amd64,linux/arm64 -t githubexporter/github-exporter:$version --push .
23+
docker buildx build --platform linux/amd64,linux/arm64 -t githubexporter/github-exporter:latest -t githubexporter/github-exporter:$version --push .

0 commit comments

Comments
 (0)