-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
117 lines (100 loc) · 2.46 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
stages:
- deploy
- rollback
# ENV:(local|dev|stg|prod)
# -------------------------------------------------------
# -- templates
# -------------------------------------------------------
# -- parameters
.image_template: &image_definition
image: dcr.mfb.io/data/spark-runner-image:latest
.tag_template_dev: &tag_definition_team_runner_dev
tags:
- lambda-dev-eu-west-1
.tag_template_prod: &tag_definition_team_runner_prod
tags:
- lambda-prod-eu-west-1
# -- environments
.dev_template: &dev_environment
variables:
ENV: "dev"
DOCKER_REGISTRY: ci-dump-dcr.mfb.io
NAMESPACE: data-flux-dev
KUBE_CONTEXT: ew1d2-dev
environment:
name: dev
except:
- master
.stg_template: &stg_environment
variables:
ENV: "stg"
DOCKER_REGISTRY: ci-dump-dcr.mfb.io
NAMESPACE: data-flux-stg
KUBE_CONTEXT: ew1d2-stg
environment:
name: stg
only:
- master
.prod_template: &prod_environment
variables:
ENV: "prod"
DOCKER_REGISTRY: dcr.mfb.io
NAMESPACE: data-flux
KUBE_CONTEXT: ew1p3
environment:
name: prod
only:
- master
# -- jobs
.deploy_template: &deploy_job
stage: deploy
script:
- task docker.build
- task spark.helm.deploy
.undeploy_template: &undeploy_job
stage: rollback
script:
- task spark.helm.undeploy
# -------------------------------------------------------
# -- process:deploying a feature branch in the cloud (DEV)
# -------------------------------------------------------
deploy-dev:
<<: *image_definition
<<: *dev_environment
<<: *deploy_job
<<: *tag_definition_team_runner_dev
undeploy-dev:
<<: *image_definition
<<: *dev_environment
<<: *undeploy_job
<<: *tag_definition_team_runner_dev
when: manual
# -------------------------------------------------------
# -- process:deploying current state of master branch in
# -- the cloud (STG), test integration and may manually
# -- deploy to PROD
# -------------------------------------------------------
deploy-stg:
<<: *image_definition
<<: *stg_environment
<<: *deploy_job
<<: *tag_definition_team_runner_dev
undeploy-stg:
<<: *image_definition
<<: *stg_environment
<<: *undeploy_job
<<: *tag_definition_team_runner_dev
when: manual
deploy-prod:
<<: *image_definition
<<: *prod_environment
<<: *deploy_job
<<: *tag_definition_team_runner_prod
when: manual
undeploy-prod:
<<: *image_definition
<<: *prod_environment
<<: *undeploy_job
<<: *tag_definition_team_runner_prod
when: manual