.gitlab-ci.yml 983 Bytes
Newer Older
Nane Kratzke's avatar
Nane Kratzke committed
1
2
stages:
    - deploy
Nane Kratzke's avatar
Nane Kratzke committed
3
    - inject
Nane Kratzke's avatar
Nane Kratzke committed
4
5
6
7
8
9
10
    - teardown

variables:
  KUBECTL: "transit/kubectl-plus:v1.19.4"
  CLUSTER: "rig.th-luebeck.dev"

yelb:
Nane Kratzke's avatar
Nane Kratzke committed
11
12
13
14
  stage: deploy
  image: $KUBECTL
  script:
    - NS=$(kubectl config view --minify --output 'jsonpath={..namespace}')
Nane Kratzke's avatar
Nane Kratzke committed
15
    - VHOST=yelb.$NS.$CLUSTER
Nane Kratzke's avatar
Nane Kratzke committed
16
    - echo $VHOST
Nane Kratzke's avatar
Nane Kratzke committed
17
18
19
20
21
22
23
24
    - mo deploy/yelb.yaml | kubectl apply -f -

istio:
  stage: inject
  image: $KUBECTL
  when: manual
  script:
    - NS=$(kubectl config view --minify --output 'jsonpath={..namespace}')
Nane Kratzke's avatar
Nane Kratzke committed
25
    - VHOST=yelb.$NS.$CLUSTER
Nane Kratzke's avatar
Nane Kratzke committed
26
27
28
29
30
31
32
33
34
35
36
    - kubectl label ns $NS istio-inject=enabled --overwrite
    - mo deploy/yelb.yaml | kubectl delete -f -
    - sleep 5
    - mo deploy/yelb.yaml | kubectl apply -f -

shutdown:
  stage: teardown
  image: $KUBECTL
  when: manual
  script:
    - NS=$(kubectl config view --minify --output 'jsonpath={..namespace}')
Nane Kratzke's avatar
Nane Kratzke committed
37
    - VHOST=yelb.$NS.$CLUSTER
Nane Kratzke's avatar
Nane Kratzke committed
38
39
    - kubectl label ns $NS istio-inject=disabled --overwrite
    - mo deploy/yelb.yaml | kubectl delete -f -