forked from IDR/k8s-analysis-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
151 lines (134 loc) · 3.37 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
######################################################################
# Common settings
image: imagedata/kube-helm-docker:0.2.0
stages:
- setup
- staging
- approval
- production
variables:
# Don't use default since we need extra permissions for deployment
KUBERNETES_SERVICE_ACCOUNT_OVERWRITE: gitlab-runner
before_script:
# Helm may not be installed so don't fail
- helm version || true
- helm list || true
######################################################################
# Jobs
# Deployment logs are public so ensure all you never echo any secret
# variables
# Install or upgrade helm
# This is always run
setup:
stage: setup
script:
- sh gitlab-ci/install-helm.sh
only:
- master
# Staging is run automatically when master is updated
# Deletes an existing deployment before installing
staging:
stage: staging
before_script:
- helm list
# Disable delete for now to see if it fixes an redeployment problem
#- helmfile --hide-args --selector application=staging delete || true
script:
- sh gitlab-ci/deploy.sh
# TODO: Check we can run singleuser servers
environment:
name: staging-staging
url: https://idr-analysis.openmicroscopy.org/staging
only:
- master
# Production requires a manual trigger
approval:
stage: approval
script:
- echo Manual approval required
allow_failure: false
only:
- master
when: manual
# Training (no login) production
# Upgrades if already installed
deploy_training:
stage: production
script:
- sh gitlab-ci/deploy.sh
# TODO: Check we can run singleuser servers
environment:
name: production-training
url: https://idr-analysis.openmicroscopy.org/training
only:
- master
# ITR Public (no login) production
# Upgrades if already installed
deploy_itr_public:
stage: production
script:
- sh gitlab-ci/deploy.sh
# TODO: Check we can run singleuser servers
environment:
name: production-itr-public
url: https://idr-analysis.openmicroscopy.org/itr-public
only:
- master
# Public (no login) production
# Upgrades if already installed
deploy_public:
stage: production
script:
- sh gitlab-ci/deploy.sh
# TODO: Check we can run singleuser servers
environment:
name: production-public
url: https://idr-analysis.openmicroscopy.org/public
only:
- master
# VAE production
# Upgrades if already installed
deploy_vae:
stage: production
script:
- sh gitlab-ci/deploy.sh
# TODO: Check we can run singleuser servers
environment:
name: production-vae
url: https://idr-analysis.openmicroscopy.org/vae
only:
- master
# VAE AAI production
# Upgrades if already installed
deploy_vaeaai:
stage: production
script:
- sh gitlab-ci/deploy.sh
# TODO: Check we can run singleuser servers
environment:
name: production-vae-aai
url: https://idr-analysis.openmicroscopy.org/vae-aai
only:
- master
# Website
# Upgrades if already installed
deploy_website:
stage: production
script:
- helmfile --selector application=website sync
environment:
name: production-website
url: https://idr-analysis.openmicroscopy.org/
only:
- master
# Monitoring
# Upgrades if already installed
deploy_monitoring:
stage: production
script:
- helmfile --selector application=monitoring sync
environment:
name: production-monitoring
url: https://idr-analysis.openmicroscopy.org/grafana
only:
- master