Split out dev/prod docker builds into parallel jobs.

This commit is contained in:
James Polley 2017-10-04 23:40:47 +11:00
parent f6b629bd60
commit d7065ee43d

View file

@ -1,17 +1,26 @@
build_image: build_test_image:
image: docker:git
services:
- docker:dind
script:
- docker build --build-arg CI_COMMIT_SHA=$CI_COMMIT_SHA -f docker/Dockerfile.dev -t asia.gcr.io/linuxconfsydney/symposion_app_dev:$CI_COMMIT_SHA .
- docker login -u _json_key -p "$GOOGLE_KEY" https://asia.gcr.io
- docker push asia.gcr.io/linuxconfsydney/symposion_app_dev:$CI_COMMIT_SHA
- docker tag asia.gcr.io/linuxconfsydney/symposion_app_dev:$CI_COMMIT_SHA asia.gcr.io/linuxconfsydney/symposion_app_dev:latest
- docker push asia.gcr.io/linuxconfsydney/symposion_app_dev:latest
only:
- master
build_prod_image:
image: docker:git image: docker:git
services: services:
- docker:dind - docker:dind
script: script:
- docker build -f docker/Dockerfile -t asia.gcr.io/linuxconfsydney/symposion_app:$CI_COMMIT_SHA . - docker build -f docker/Dockerfile -t asia.gcr.io/linuxconfsydney/symposion_app:$CI_COMMIT_SHA .
- docker build --build-arg CI_COMMIT_SHA=$CI_COMMIT_SHA -f docker/Dockerfile.dev -t asia.gcr.io/linuxconfsydney/symposion_app_dev:$CI_COMMIT_SHA .
- docker login -u _json_key -p "$GOOGLE_KEY" https://asia.gcr.io - docker login -u _json_key -p "$GOOGLE_KEY" https://asia.gcr.io
- docker push asia.gcr.io/linuxconfsydney/symposion_app:$CI_COMMIT_SHA - docker push asia.gcr.io/linuxconfsydney/symposion_app:$CI_COMMIT_SHA
- docker push asia.gcr.io/linuxconfsydney/symposion_app_dev:$CI_COMMIT_SHA
- docker tag asia.gcr.io/linuxconfsydney/symposion_app:$CI_COMMIT_SHA asia.gcr.io/linuxconfsydney/symposion_app:latest - docker tag asia.gcr.io/linuxconfsydney/symposion_app:$CI_COMMIT_SHA asia.gcr.io/linuxconfsydney/symposion_app:latest
- docker tag asia.gcr.io/linuxconfsydney/symposion_app_dev:$CI_COMMIT_SHA asia.gcr.io/linuxconfsydney/symposion_app_dev:latest
- docker push asia.gcr.io/linuxconfsydney/symposion_app:latest - docker push asia.gcr.io/linuxconfsydney/symposion_app:latest
- docker push asia.gcr.io/linuxconfsydney/symposion_app_dev:latest
only: only:
- master - master