image: registry.uninett.no/system/kubernetes-deploy:v0.13 variables: KUBE_PROD_DOMAIN: play.oauth.no # The main domain for your application. KUBE_TEST_DOMAIN: play-oauth.paas2.uninett.no # A domain which test versions of your application can be launched under. KUBE_REVIEW_DOMAIN: play-oauth-review.paas2.uninett.no # A domain which review versions of your application can be launched under. HTTP_PORT: '3000' # The port number of the web server. REPLICAS: '1' stages: - build - test - review - staging - production build: stage: build script: - build only: - branches production: stage: production variables: CI_ENVIRONMENT_URL: https://$KUBE_PROD_DOMAIN REPLICAS: '2' script: - deploy kubernetes/deployment.yaml environment: name: production url: https://$KUBE_PROD_DOMAIN when: manual only: - master staging: stage: staging variables: CI_ENVIRONMENT_URL: https://$KUBE_TEST_DOMAIN script: - deploy kubernetes/deployment.yaml environment: name: staging url: https://$KUBE_TEST_DOMAIN only: - master review: stage: review variables: CI_ENVIRONMENT_URL: https://$KUBE_REVIEW_DOMAIN script: - deploy kubernetes/deployment.yaml environment: name: review/$CI_BUILD_REF_NAME url: https://$KUBE_REVIEW_DOMAIN on_stop: stop_review only: - branches except: - master stop_review: stage: review variables: GIT_STRATEGY: none script: - destroy environment: name: review/$CI_BUILD_REF_NAME action: stop when: manual only: - branches except: - master