CI: Move Docker scripts to /scripts/docker

This commit is contained in:
Michael Mayer 2021-12-10 17:01:45 +01:00
parent a42cf636aa
commit 704953e867
7 changed files with 28 additions and 22 deletions

View file

@ -23,7 +23,7 @@ steps:
CODECOV_TOKEN:
from_secret: codecov_token
commands:
- scripts/docker-login.sh
- scripts/login.sh
- docker-compose -f docker-compose.ci.yml pull
- docker-compose -f docker-compose.ci.yml stop
- docker-compose -f docker-compose.ci.yml up -d --build --force-recreate
@ -61,7 +61,7 @@ steps:
DOCKER_PASSWORD:
from_secret: docker_password
commands:
- scripts/docker-login.sh
- scripts/login.sh
- scripts/install-qemu.sh
- make docker-preview
when:
@ -77,7 +77,7 @@ steps:
DOCKER_PASSWORD:
from_secret: docker_password
commands:
- scripts/docker-login.sh
- scripts/login.sh
- docker pull photoprism/photoprism:preview
- make docker-demo
when:
@ -93,7 +93,7 @@ steps:
DOCKER_PASSWORD:
from_secret: docker_password
commands:
- scripts/docker-login.sh
- scripts/login.sh
- scripts/install-qemu.sh
- make docker-release
when:
@ -158,7 +158,7 @@ steps:
DOCKER_PASSWORD:
from_secret: docker_password
commands:
- scripts/docker-login.sh
- scripts/login.sh
- docker-compose -f docker-compose.ci.yml stop
- docker-compose -f docker-compose.ci.yml up -d --build --force-recreate

View file

@ -205,37 +205,37 @@ clean:
docker-development:
docker pull --platform=amd64 ubuntu:21.10
docker pull --platform=arm64 ubuntu:21.10
scripts/docker-buildx.sh development linux/amd64,linux/arm64 $(DOCKER_TAG)
scripts/docker/multarch.sh development linux/amd64,linux/arm64 $(DOCKER_TAG)
docker-preview:
scripts/docker-buildx.sh photoprism linux/amd64,linux/arm64
scripts/docker/multarch.sh photoprism linux/amd64,linux/arm64
docker-release:
scripts/docker-buildx.sh photoprism linux/amd64,linux/arm64 $(DOCKER_TAG)
scripts/docker/multarch.sh photoprism linux/amd64,linux/arm64 $(DOCKER_TAG)
docker-armv7-preview:
scripts/docker-buildx.sh photoprism linux/arm armv7-preview /armv7
scripts/docker/multarch.sh photoprism linux/arm armv7-preview /armv7
docker-armv7-release:
scripts/docker-buildx.sh photoprism linux/arm armv7 /armv7
scripts/docker/multarch.sh photoprism linux/arm armv7 /armv7
docker-local:
scripts/docker-build.sh photoprism
scripts/docker/build.sh photoprism
docker-pull:
docker pull photoprism/photoprism:preview photoprism/photoprism:latest
docker-goproxy:
docker pull golang:alpine
scripts/docker-buildx.sh goproxy linux/amd64,linux/arm64 $(DOCKER_TAG)
scripts/docker/multarch.sh goproxy linux/amd64,linux/arm64 $(DOCKER_TAG)
docker-demo:
scripts/docker-build.sh demo $(DOCKER_TAG)
scripts/docker-push.sh demo $(DOCKER_TAG)
scripts/docker/build.sh demo $(DOCKER_TAG)
scripts/docker/push.sh demo $(DOCKER_TAG)
docker-demo-local:
scripts/docker-build.sh photoprism
scripts/docker-build.sh demo $(DOCKER_TAG)
scripts/docker-push.sh demo $(DOCKER_TAG)
scripts/docker/build.sh photoprism
scripts/docker/build.sh demo $(DOCKER_TAG)
scripts/docker/push.sh demo $(DOCKER_TAG)
docker-dummy-webdav:
docker pull --platform=amd64 golang:1
docker pull --platform=arm64 golang:1
scripts/docker-buildx.sh dummy-webdav linux/amd64,linux/arm64 $(DOCKER_TAG)
scripts/docker/multarch.sh dummy-webdav linux/amd64,linux/arm64 $(DOCKER_TAG)
docker-dummy-oidc:
docker pull --platform=amd64 golang:1
docker pull --platform=arm64 golang:1
scripts/docker-buildx.sh dummy-oidc linux/amd64,linux/arm64 $(DOCKER_TAG)
scripts/docker/multarch.sh dummy-oidc linux/amd64,linux/arm64 $(DOCKER_TAG)
packer-digitalocean:
$(info Buildinng DigitalOcean marketplace image...)
(cd ./docker/examples/cloud && packer build digitalocean.json)

View file

@ -38,7 +38,7 @@ elif [[ $2 =~ $NUMERIC ]]; then
else
echo "Building 'photoprism/$1:$2' in docker/${1/-//}$3/Dockerfile...";
DOCKER_TAG=$(date -u +%Y%m%d)
docker build \
docker build $4\
--no-cache \
--pull \
--build-arg BUILD_TAG=$DOCKER_TAG \

View file

@ -6,6 +6,8 @@ if [[ -z $DOCKER_PASSWORD ]] || [[ -z $DOCKER_USERNAME ]]; then
docker login
fi
NUMERIC='^[0-9]+$'
if [[ -z $1 ]] && [[ -z $2 ]]; then
echo "Please provide a container image name and version" 1>&2
exit 1
@ -13,9 +15,13 @@ elif [[ $1 ]] && [[ -z $2 ]]; then
echo "Pushing 'photoprism/$1:preview' to Docker hub...";
docker push photoprism/$1:preview
echo "Done"
else
elif [[ $2 =~ $NUMERIC ]]; then
echo "Pushing 'photoprism/$1:$2' to Docker hub...";
docker push photoprism/$1:latest
docker push photoprism/$1:$2
echo "Done"
else
echo "Pushing 'photoprism/$1:$2' to Docker hub...";
docker push photoprism/$1:$2
echo "Done"
fi

View file

@ -3,7 +3,7 @@
set -e
# Login
scripts/docker-login.sh
scripts/docker/login.sh
# Run tests
docker-compose -f docker-compose.ci.yml pull