docspell/docker/dockerfiles/build.sh
eikek 71b913b19f Add a release actions
Github workflows to create a nightly release automatically and a
stable release semi-automatic (a 2-step process).
2021-05-31 14:42:43 +02:00

60 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "Please specify a version"
exit 1
fi
version="$1"
if [[ $version == v* ]]; then
version="${version:1}"
fi
set -e
cd "$(dirname "$0")"
if [[ $version == *SNAPSHOT* ]]; then
echo ">>>> Building nightly images for $version <<<<<"
url_base="https://github.com/eikek/docspell/releases/download/nightly"
echo "============ Building Tools ============"
docker build \
--build-arg tools_url="$url_base/docspell-tools-$version.zip" \
--tag docspell/tools:nightly \
-f tools.dockerfile .
echo "============ Building Restserver ============"
docker build \
--build-arg restserver_url="$url_base/docspell-restserver-$version.zip" \
--tag docspell/restserver:nightly \
-f restserver.dockerfile .
echo "============ Building Joex ============"
docker build \
--build-arg joex_url="$url_base/docspell-joex-$version.zip" \
--tag docspell/joex:nightly \
-f joex.dockerfile .
else
echo ">>>> Building release images for $version <<<<<"
echo "============ Building Tools ============"
docker build \
--build-arg version=$version \
--tag docspell/tools:v$version \
--tag docspell/tools:latest \
-f tools.dockerfile .
echo "============ Building Restserver ============"
docker build \
--build-arg version=$version \
--tag docspell/restserver:v$version \
--tag docspell/restserver:latest \
-f restserver.dockerfile .
echo "============ Building Joex ============"
docker build \
--build-arg version=$version \
--tag docspell/joex:v$version \
--tag docspell/joex:latest \
-f joex.dockerfile .
fi