CI: Add build targets and improve docker-build.sh

Signed-off-by: Michael Mayer <michael@lastzero.net>
This commit is contained in:
Michael Mayer 2020-10-13 22:46:20 +02:00
parent 2e31120cda
commit 123fa0e43e
3 changed files with 10 additions and 3 deletions

View file

@ -49,7 +49,7 @@ steps:
from_secret: docker_password
commands:
- scripts/docker-login.sh
- make docker-photoprism docker-demo
- make docker-photoprism docker-photoprism-pull docker-demo
when:
status:
- success

View file

@ -166,12 +166,15 @@ docker-development:
docker-photoprism:
scripts/docker-build.sh photoprism $(DOCKER_TAG)
scripts/docker-push.sh photoprism $(DOCKER_TAG)
docker-photoprism-local:
scripts/docker-build.sh photoprism
docker-photoprism-pull:
docker pull photoprism/photoprism:latest
docker-photoprism-arm64:
docker pull ubuntu:20.04
scripts/docker-build.sh photoprism-arm64 $(DOCKER_TAG)
scripts/docker-push.sh photoprism-arm64 $(DOCKER_TAG)
docker-demo:
docker pull photoprism/photoprism:latest
scripts/docker-build.sh demo $(DOCKER_TAG)
scripts/docker-push.sh demo $(DOCKER_TAG)
docker-webdav:

View file

@ -1,8 +1,12 @@
#!/usr/bin/env bash
if [[ -z $1 ]] || [[ -z $2 ]]; then
if [[ -z $1 ]] && [[ -z $2 ]]; then
echo "Please provide a container image name and version" 1>&2
exit 1
elif [[ $1 ]] && [[ -z $2 ]]; then
echo "Building 'photoprism/$1:latest'...";
docker build --no-cache --build-arg BUILD_TAG=$2 -t photoprism/$1:latest -f docker/${1/-//}/Dockerfile .
echo "Done"
else
echo "Building 'photoprism/$1:$2'...";
docker build --no-cache --build-arg BUILD_TAG=$2 -t photoprism/$1:latest -t photoprism/$1:$2 -f docker/${1/-//}/Dockerfile .