circleci-matrix: Push images as part of the test step

To workaround, CircleCI limitation [1]:

"Please note that since we do not support parallel deployment, specifying
‘parallel:true’ in the deployment phase will cause an error."

This commit moves the deployment step as the last action of the test
step. Doing so will ensure, every container will take care of pushing
images it was responsible to build.

[1] https://circleci.com/docs/parallel-manual-setup/#simple-example
This commit is contained in:
Jean-Christophe Fillion-Robin 2016-11-26 17:54:17 -05:00
parent 68393166b9
commit abc164e7c6
No known key found for this signature in database
GPG Key ID: 15C1A2812F958BD3
2 changed files with 6 additions and 10 deletions

View File

@ -1,3 +1,4 @@
env: env:
- IMAGE=android-arm - IMAGE=android-arm
- IMAGE=browser-asmjs - IMAGE=browser-asmjs
@ -80,7 +81,7 @@ command:
mkdir -p ~/docker; time docker save dockcross/$IMAGE > ~/docker/$IMAGE.tar mkdir -p ~/docker; time docker save dockcross/$IMAGE > ~/docker/$IMAGE.tar
echo "Saving dockcross/$IMAGE into ~/docker cache - done" echo "Saving dockcross/$IMAGE into ~/docker cache - done"
fi fi
if [[ $STEP == "deployment" ]]; then if [[ $STEP == "deployment" ]] && [[ "$CIRCLE_BRANCH" == "master" ]]; then
echo "Docker login" echo "Docker login"
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
echo "Docker login - done" echo "Docker login - done"

View File

@ -26,13 +26,8 @@ test:
timeout: 3000 timeout: 3000
environment: environment:
STEP: test STEP: test
deployment:
hub:
branch: master
commands:
- circleci-matrix: - circleci-matrix:
parallel: true parallel: true
timeout: 1800
environment: environment:
STEP: deployment STEP: deployment