-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·23 lines (19 loc) · 830 Bytes
/
deploy.sh
File metadata and controls
executable file
·23 lines (19 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
# extract docker-machine certificate from DOCKER_MACHINE_CERT and configure
export DOCKER_CERT_PATH=$HOME/.docker/machine/certs
mkdir -p $DOCKER_CERT_PATH
echo $DOCKER_MACHINE_CERT | base64 -d | gzip -d | tar -x -C $DOCKER_CERT_PATH
# extract dockerhub auth file
if [ ! -z "$DOCKER_CREDENTIAL" ]; then
echo $DOCKER_CREDENTIAL | base64 -d | gzip -d > $HOME/.docker/config.json
fi
# extract docker-compose related files, docker-compose.yml must be in a
# directory named the same as previously used
cd $HOME
mkdir -p $DOCKER_COMPOSE_DIR_NAME
cd $DOCKER_COMPOSE_DIR_NAME
echo $DOCKER_COMPOSE | base64 -d | gzip -d > docker-compose.yml
docker-compose pull
docker-compose down -v
docker-compose up -d --remove-orphans
docker rmi $(docker images -a -q) || true # non 0 exit code doesn't matter for removing unused images