.gitlab-ci.yml 971 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 mo deploy/yelb.yaml | kubectl apply -f -
Nane Kratzke's avatar
Nane Kratzke committed
16
17
18
19
20
21
22
23

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

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