19 lines
360 B
Bash
Executable File
19 lines
360 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
REGISTRY="harbor.cl1.parano.ch/library"
|
|
IMAGE="myice"
|
|
|
|
current_commit=$(git rev-parse HEAD)
|
|
|
|
git_tag=$(git tag --points-at "$current_commit")
|
|
|
|
if [[ -z $git_tag ]]; then
|
|
echo "Build only works on a git tag" >&2
|
|
exit 1
|
|
fi
|
|
|
|
docker build --platform linux/amd64 -t "$REGISTRY/$IMAGE:$git_tag" .
|
|
docker push "$REGISTRY/$IMAGE:$git_tag"
|