miom.space/deploy.sh

30 lines
737 B
Bash
Raw Normal View History

2022-01-16 18:32:04 +00:00
#!/usr/bin/env bash
2023-02-26 19:21:34 +00:00
# Abort on first error
2022-01-16 18:32:04 +00:00
set -e
TAG="$1"
if [[ -z "$TAG" ]]; then
echo
2022-01-17 09:51:34 +00:00
echo "Error: please provide a version as docker image tag as first argument, e.g.:"
2022-01-16 18:32:04 +00:00
echo "./deploy.sh 1.0.0"
echo
2022-01-16 21:02:12 +00:00
echo "You can check the currently deployed tag with"
2022-01-17 09:51:34 +00:00
echo 'docker ps --format "{{.Names}}: {{.Image}}"'
2022-01-16 21:02:12 +00:00
echo
2022-01-16 18:32:04 +00:00
exit 1
fi
2023-02-27 16:45:53 +00:00
# Login to Greenbaum's private docker registry
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin registry.greenbaum.cloud
2023-02-27 16:45:53 +00:00
2023-02-26 19:21:34 +00:00
# Use our tag for docker-compose
2022-01-16 18:32:04 +00:00
export DEPLOY_TAG="$TAG"
2023-02-26 19:21:34 +00:00
# Pull the latest image
docker pull registry.greenbaum.cloud/pub_solar/miom.space:"$DEPLOY_TAG"
# Deploy on Greenbaum Cloud
2023-02-28 01:24:14 +00:00
docker-compose --project-name miomspace up --detach