gitea-pages/make-release.sh

40 lines
734 B
Bash
Raw Normal View History

2024-06-23 13:55:53 +02:00
#!/bin/bash
set -e
usage="$(basename "$0") [-h] [-t RELEASE_VERSION ]
The script compiles Caddy server with GiteaPages plugin, and publishes the resulting image
to the https://hub.docker.com/u/djmil
Where:
-t RELEASE_VERSION
A major.minor.patch tag for the image being publisdhed.
"
tag=''
while getopts ht: flag
do
case "${flag}" in
t) tag=${OPTARG};;
h) echo "$usage"; exit 0;;
*) echo "$usage" >&2; exit 1;;
esac
done
if [ ! "$tag" ]; then
echo 'Missing: -t RELEASE_VERSION' >&2
exit 1
fi
echo "Tag: $tag";
docker build --tag djmil/gitea-pages:$tag .
#git tag
#git push tag
docker login --username djmil #--password-stdin
docker push djmil/gitea-pages:$tag