Skip to content

Instantly share code, notes, and snippets.

@BenHall
Last active January 16, 2017 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenHall/7a44bd716c7eb243cf4ecccd06141774 to your computer and use it in GitHub Desktop.
Save BenHall/7a44bd716c7eb243cf4ecccd06141774 to your computer and use it in GitHub Desktop.
variables:
IMAGE_NAME: https://HOST2_SUBDOMAIN-80-KATACODA_HOST.environments.katacoda.com/root/front-end
TAG: $CI_BUILD_ID
stages:
- build
- push
- cleanup
build_production:
stage: build
script:
- docker build -t $IMAGE_NAME:$TAG .
only:
- master
push_production:
stage: build
script:
- docker push $IMAGE_NAME:$TAG
only:
- master
cleanup_production:
stage: cleanup
script:
- docker rmi $( docker images | grep '<none>' | tr -s ' ' | cut -d ' ' -f 3)
only:
- master
allow_failure: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment