miom.space/deploy.sh
teutat3s f82f10596c
All checks were successful
continuous-integration/drone/push Build is passing
ci: fix docker login using --password-stdin
2023-02-27 20:38:04 +01:00

30 lines
706 B
Bash
Executable file

#!/usr/bin/env bash
# Abort on first error
set -e
TAG="$1"
if [[ -z "$TAG" ]]; then
echo
echo "Error: please provide a version as docker image tag as first argument, e.g.:"
echo "./deploy.sh 1.0.0"
echo
echo "You can check the currently deployed tag with"
echo 'docker ps --format "{{.Names}}: {{.Image}}"'
echo
exit 1
fi
# Login to Greenbaum's private docker registry
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin registry.greenbaum.cloud
# Use our tag for docker-compose
export DEPLOY_TAG="$TAG"
# Pull the latest image
docker pull registry.greenbaum.cloud/pub_solar/miom.space:"$DEPLOY_TAG"
# Deploy on Greenbaum Cloud
docker-compose up -d