Browse Source

Be smarter about tag creation

master
Nico Schottelius 4 months ago
parent
commit
838f4c4c73
  1. 13
      build.sh

13
build.sh

@ -6,8 +6,17 @@ docker build -t ungleich-hardware .
while [ $# -ge 1 ]; do
tag=$1; shift
git tag -a -m "Version $tag" $tag
git push --tags
# Does the tag exist?
if git rev-list "$tag" 2>/dev/null; then
cur=$(git describe)
if [ $cur != $tag ]; then
echo "Requested build for $tag, but we are on $cur, aborting"
exit 1
fi
else
git tag -a -m "Version $tag" $tag
git push --tags
fi
docker tag ungleich-hardware:latest ungleich/ungleich-hardware:${tag}
docker tag ungleich-hardware:latest harbor.ungleich.svc.p10.k8s.ooo/ungleich-public/ungleich-hardware:${tag}
docker push ungleich/ungleich-hardware:${tag}

Loading…
Cancel
Save