Files
gotenberg/scripts/publish.sh
2018-12-10 16:36:34 +01:00

31 lines
894 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
set -e
GOLANG_VERSION=1.11.2
VERSION="$1"
DOCKER_USER="$2"
DOCKER_PASSWORD="$3"
docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
SEMVER=( ${VERSION//./ } )
VERSION_LENGTH=${#SEMVER[@]}
if [ $VERSION_LENGTH -ne 3 ]; then
echo "$VERSION is not semver."
exit 1
fi
docker build -t thecodingmachine/gotenberg:base -f build/base/Dockerfile .
docker build \
--build-arg GOLANG_VERSION=${GOLANG_VERSION} \
--build-arg VERSION=${VERSION} \
-t thecodingmachine/gotenberg:${SEMVER[0]} \
-t thecodingmachine/gotenberg:${SEMVER[0]}.${SEMVER[1]} \
-t thecodingmachine/gotenberg:${SEMVER[0]}.${SEMVER[1]}.${SEMVER[2]} \
-f build/package/Dockerfile .
docker push "thecodingmachine/gotenberg:${SEMVER[0]}"
docker push "thecodingmachine/gotenberg:${SEMVER[0]}.${SEMVER[1]}"
docker push "thecodingmachine/gotenberg:${SEMVER[0]}.${SEMVER[1]}.${SEMVER[2]}"