Don't try to seperate the dev/non-dev image builds

The dev image build uses the prod image build as a base. It doesn't
make sense to seperate them as they need to be sequential, and the
fastest way to do them is to re-use the environment from the first build
This commit is contained in:
James Polley 2018-07-02 02:00:11 +10:00
parent 0c58a94323
commit 2e77bb2d60

View file

@ -61,6 +61,10 @@ build_2019_image:
- docker pull "${CONTAINER_IMAGE_2019}":latest || true - docker pull "${CONTAINER_IMAGE_2019}":latest || true
- docker build --cache-from "${CONTAINER_IMAGE_2019}":latest -f docker/Dockerfile -t "${CONTAINER_IMAGE_2019}":$CI_COMMIT_SHA . - docker build --cache-from "${CONTAINER_IMAGE_2019}":latest -f docker/Dockerfile -t "${CONTAINER_IMAGE_2019}":$CI_COMMIT_SHA .
- docker push "${CONTAINER_IMAGE_2019}":$CI_COMMIT_SHA - docker push "${CONTAINER_IMAGE_2019}":$CI_COMMIT_SHA
- docker build --build-arg CI_COMMIT_SHA=$CI_COMMIT_SHA -f docker/Dockerfile.dev -t "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_SHA .
- docker push "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_SHA
- docker tag "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_SHA "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_REF_SLUG
- docker push "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_REF_SLUG
except: except:
- "2019" - "2019"
- "dev/2019" - "dev/2019"
@ -81,21 +85,6 @@ build_2019_image:
name: 2019/prod name: 2019/prod
url: https://2019.linux.conf.au url: https://2019.linux.conf.au
build_2019_dev_image:
image: docker:git
stage: build
services:
- docker:dind
script:
- docker login -u _json_key -p "$GOOGLE_KEY" https://asia.gcr.io
- docker pull "${CONTAINER_IMAGE_2019}"_dev:latest || true
- docker build --cache-from "${CONTAINER_IMAGE_2019}"_dev:latest --build-arg CI_COMMIT_SHA=$CI_COMMIT_SHA -f docker/Dockerfile.dev -t "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_SHA .
- docker push "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_SHA
- docker tag "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_SHA "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_REF_SLUG
- docker push "${CONTAINER_IMAGE_2019}"_dev:$CI_COMMIT_REF_SLUG
except:
- master
2019_dev-deploy: 2019_dev-deploy:
image: google/cloud-sdk image: google/cloud-sdk
stage: deploy stage: deploy