Commit 7a6be14c authored by Morten Knutsen's avatar Morten Knutsen

Merge branch 'update_deploy' into 'master'

Update to use gitlab-ci-helpers and update deprecated Deployment apiVersion

See merge request !1
parents 5a03a012 66213dde
Pipeline #22107 passed with stages
in 5 minutes and 27 seconds
image: registry.uninett.no/asm/kubernetes-deploy:v0.13
include:
- project: 'asm/gitlab-ci-helpers'
file: '/gitlab-ci-helpers.yml'
variables:
KUBE_PROD_DOMAIN: dkim.paas2.uninett.no
......@@ -14,57 +16,31 @@ stages:
- production
build:
extends: .docker-build
stage: build
script:
- build
only:
- branches
production:
extends: .production
stage: production
variables:
REPLICAS: "2"
script:
- deploy dist/kubernetes.yml
environment:
name: production
url: https://$KUBE_PROD_DOMAIN
when: manual
only:
- master
staging:
extends: .staging
stage: staging
script:
- deploy dist/kubernetes.yml
environment:
name: staging
url: https://$KUBE_TEST_ID-staging.paas2.uninett.no
only:
- master
review:
extends: .review
stage: review
script:
- deploy dist/kubernetes.yml
environment:
name: review/$CI_BUILD_REF_NAME
url: https://$KUBE_TEST_ID-$CI_ENVIRONMENT_SLUG.paas2.uninett.no
on_stop: stop_review
only:
- branches
except:
- master
stop_review:
extends: .stop_review
stage: review
script:
- destroy
environment:
name: review/$CI_BUILD_REF_NAME
action: stop
when: manual
only:
- branches
except:
- master
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: $CI_ENVIRONMENT_SLUG
......@@ -9,6 +9,9 @@ metadata:
build_id: "$CI_BUILD_ID"
spec:
replicas: $REPLICAS
selector:
matchLabels:
app: $CI_ENVIRONMENT_SLUG
template:
metadata:
labels:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment