Be smarter about tag creation
This commit is contained in:
parent
7707f440ee
commit
838f4c4c73
1 changed files with 11 additions and 2 deletions
9
build.sh
9
build.sh
|
@ -6,8 +6,17 @@ docker build -t ungleich-hardware .
|
||||||
|
|
||||||
while [ $# -ge 1 ]; do
|
while [ $# -ge 1 ]; do
|
||||||
tag=$1; shift
|
tag=$1; shift
|
||||||
|
# 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 tag -a -m "Version $tag" $tag
|
||||||
git push --tags
|
git push --tags
|
||||||
|
fi
|
||||||
docker tag ungleich-hardware:latest ungleich/ungleich-hardware:${tag}
|
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 tag ungleich-hardware:latest harbor.ungleich.svc.p10.k8s.ooo/ungleich-public/ungleich-hardware:${tag}
|
||||||
docker push ungleich/ungleich-hardware:${tag}
|
docker push ungleich/ungleich-hardware:${tag}
|
||||||
|
|
Loading…
Reference in a new issue