.gitlab-ci.yml 1.9 KB
Newer Older
Nane Kratzke's avatar
Nane Kratzke committed
1
2
image: "transit/kubectl-plus:v1.19.4"

Nane Kratzke's avatar
Nane Kratzke committed
3
stages:
Nane Kratzke's avatar
pubsub    
Nane Kratzke committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
- prepare
- build
- deploy
- terminate

secrets:
  stage: prepare
  script:
    - kubectl delete secret gitlab-registry-credentials || true
    - "kubectl create secret docker-registry gitlab-registry-credentials \
            --docker-server=$CI_REGISTRY \
            --docker-username=image-registry \ 
            --docker-password=$CI_REGISTRY_TOKEN \ 
        "
Nane Kratzke's avatar
Nane Kratzke committed
18
19
20
21
22
23

volumes:
    stage: prepare
    script:
    - kubectl apply -f volumes/redis-pvc.yaml

Nane Kratzke's avatar
Nane Kratzke committed
24
container:
Nane Kratzke's avatar
pubsub    
Nane Kratzke committed
25
26
27
28
29
30
31
  stage: build
  image:
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [""]
  only:
    changes:
    - .gitlab-ci.yml
Nane Kratzke's avatar
Nane Kratzke committed
32
33
    - messaging/*
    - messaging/*/*
Nane Kratzke's avatar
pubsub    
Nane Kratzke committed
34
35
36
  script:
  - mkdir -p /kaniko/.docker
  - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
Nane Kratzke's avatar
Nane Kratzke committed
37
38
  - cd messaging
  - /kaniko/executor --context . --destination $CI_REGISTRY_IMAGE:latest
Nane Kratzke's avatar
pubsub    
Nane Kratzke committed
39

Nane Kratzke's avatar
Nane Kratzke committed
40
41
42
redis:
   stage: deploy
   script:
Nane Kratzke's avatar
Nane Kratzke committed
43
   - kubectl delete -f deploy/redis-dep.yaml || true
Nane Kratzke's avatar
Nane Kratzke committed
44
45
   - kubectl apply -f deploy/redis-dep.yaml
   - kubectl apply -f deploy/redis-svc.yaml
Nane Kratzke's avatar
pubsub    
Nane Kratzke committed
46
47
48

pubsub-consumer:
    stage: deploy
Nane Kratzke's avatar
Nane Kratzke committed
49
    when: manual
Nane Kratzke's avatar
pubsub    
Nane Kratzke committed
50
51
52
53
54
55
    script:
    - mo deploy/pubsub-consumer-dep.yaml | kubectl delete -f - || true
    - mo deploy/pubsub-consumer-dep.yaml | kubectl apply -f -

pubsub-producer:
    stage: deploy
Nane Kratzke's avatar
Nane Kratzke committed
56
    when: manual
Nane Kratzke's avatar
pubsub    
Nane Kratzke committed
57
58
59
    script:
    - mo deploy/pubsub-producer-dep.yaml | kubectl delete -f - || true
    - mo deploy/pubsub-producer-dep.yaml | kubectl apply -f -
Nane Kratzke's avatar
Nane Kratzke committed
60
61
62
63
64
65
66
67
68
69
70
71
72
73

queueing-consumer:
    stage: deploy
    when: manual
    script:
    - mo deploy/queueing-consumer-dep.yaml | kubectl delete -f - || true
    - mo deploy/queueing-consumer-dep.yaml | kubectl apply -f -

queueing-producer:
    stage: deploy
    when: manual
    script:
    - mo deploy/queueing-producer-dep.yaml | kubectl delete -f - || true
    - mo deploy/queueing-producer-dep.yaml | kubectl apply -f -