diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ec9f0818..6f4af45e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 services: - docker:dind script: - 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 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_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_dev:latest only: - master