Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Commit

Permalink
Build docker images simultaneously to save time (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
thuningxu authored Apr 22, 2017
1 parent 8f2b425 commit 56214c2
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,17 @@ after_success:
- 'if [ "$BRANCH" == "master" ]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS;
export TAG=latest;
export REPO=ubercherami/cherami-server-standalone;
echo "Building docker image for TRAVIS_BRANCH=$TRAVIS_BRANCH, REPO=$REPO, PR=$PR, BRANCH=$BRANCH, TAG=$TAG";
time travis_wait 30 docker build -f docker/standalone/Dockerfile -t $REPO:$COMMIT -t $REPO:$TAG -t $REPO:travis-$TRAVIS_BUILD_NUMBER docker/standalone/;
echo "Pushing $REPO";
time travis_wait 20 docker push $REPO;
fi'
- 'if [ "$BRANCH" == "master" ]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS;
export TAG=latest;
time docker build -f docker/standalone/Dockerfile -t $REPO:$COMMIT -t $REPO:$TAG -t $REPO:travis-$TRAVIS_BUILD_NUMBER docker/standalone/ &
export REPO=ubercherami/cherami-server;
echo "Building docker image for TRAVIS_BRANCH=$TRAVIS_BRANCH, REPO=$REPO, PR=$PR, BRANCH=$BRANCH, TAG=$TAG";
time travis_wait 30 docker build -f docker/server/Dockerfile -t $REPO:$COMMIT -t $REPO:$TAG -t $REPO:travis-$TRAVIS_BUILD_NUMBER docker/server/;
echo "Pushing $REPO";
time travis_wait 20 docker push $REPO;
time travis_wait 20 docker build -f docker/server/Dockerfile -t $REPO:$COMMIT -t $REPO:$TAG -t $REPO:travis-$TRAVIS_BUILD_NUMBER docker/server/;
wait;
time docker push ubercherami/cherami-server-standalone &
time docker push ubercherami/cherami-server;
wait;
fi'

0 comments on commit 56214c2

Please sign in to comment.