forked from dask/dask-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy.sh
executable file
·31 lines (24 loc) · 882 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
set -e
# Login to docker hub
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
# Iterate through built images and tag and push appropriately
for IMAGE in $(cat docker-compose.yml | grep image: | awk '{ print $2 }'); do
# If this is not a tagged commit push to the dev label
if [ "$TRAVIS_TAG" = "" ]; then
DEV_IMAGE="$IMAGE:dev"
echo "Pushing $DEV_IMAGE"
docker tag $IMAGE $DEV_IMAGE
docker push $DEV_IMAGE
# If this is a tagged commit push to a new tag label and 'latest'
else
TAG_IMAGE="$IMAGE:$TRAVIS_TAG"
echo "Pushing $TAG_IMAGE"
docker tag $IMAGE $TAG_IMAGE
docker push $TAG_IMAGE
LATEST_IMAGE="$IMAGE:latest"
echo "Pushing $LATEST_IMAGE"
docker tag $IMAGE $LATEST_IMAGE
docker push $LATEST_IMAGE
fi
done