forked from DataBiosphere/data-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.lower-env.yml
182 lines (167 loc) · 6.19 KB
/
.gitlab-ci.lower-env.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
stages:
- test
- build
- deploy
cache:
paths:
- node_modules/
# Build Jobs
# Build Job Template
.build_template: &build_template
image: node:10.0.0
stage: build
before_script:
- git clone https://github.com/HumanCellAtlas/data-portal-content.git data-portal-content
- git clone https://github.com/HumanCellAtlas/humancellatlas.github.io
- git clone https://github.com/HumanCellAtlas/metadata-schema.git _metadata-schema
- npm install [email protected] -g
- npm -v
- npm install [email protected] --global
- npm install
artifacts:
paths:
- public
- maintenance
# Test with Trufflehog
test_trufflehog:
stage: test
image: python:3.5
before_script:
- pip install trufflehog
script:
- trufflehog --regex --rules trufflehog-rules.json --branch develop --entropy=False --max_depth 30 https://github.com/HumanCellAtlas/data-portal.git
except:
- master
# Develop Build
build_develop:
<<: *build_template
environment:
name: develop
script:
- cd_metadata-schema && git checkout develop
- export GATSBY_EXPLORE_URL=https://dev.data.humancellatlas.org/explore/
- export GATSBY_FILE_SUMMARY_API_URL=https://service.dev.explore.data.humancellatlas.org/repository/summary
- export GATSBY_TERM_FACETS_API_URL=https://service.dev.explore.data.humancellatlas.org/repository/projects
- export GATSBY_SYSTEM_HEALTH_CHECK_API_URL=https://status.dev.data.humancellatlas.org/service/dcp-health-check-dev
- export GATSBY_SYSTEM_STATUS_URL=https://status.dev.data.humancellatlas.org/
- export GATSBY_GTM_ID=GTM-M2J5NTJ
- export GATSBY_GTM_AUTH=9YN1zUWSooX9gvYK43KPlg
- export GATSBY_ENV_NAME=env-6
- export GATSBY_ENV=DEV
- gatsby build
only:
- develop
# Develop Build
build_ux-dev:
<<: *build_template
environment:
name: ux-dev
script:
- cd_metadata-schema && git checkout develop
- export GATSBY_EXPLORE_URL=https://ux-dev.data.humancellatlas.org/explore/
- export GATSBY_FILE_SUMMARY_API_URL=https://service.dev.explore.data.humancellatlas.org/repository/summary
- export GATSBY_TERM_FACETS_API_URL=https://service.dev.explore.data.humancellatlas.org/repository/projects
- export GATSBY_SYSTEM_HEALTH_CHECK_API_URL=https://status.data.humancellatlas.org/service/dcp-health-check-prod
- export GATSBY_SYSTEM_STATUS_URL=https://status.data.humancellatlas.org/
- export GATSBY_GTM_ID=GTM-M2J5NTJ
- export GATSBY_GTM_AUTH=V6JsS1EO6wZraCRRVvsrlw
- export GATSBY_ENV_NAME=env-11
- export GATSBY_ENV=UX_DEV
- gatsby build
only:
- ux-dev
# Integration Build
build_integration:
<<: *build_template
environment:
name: integration
script:
- cd_metadata-schema && git checkout integration
- export GATSBY_EXPLORE_URL=https://integration.data.humancellatlas.org/explore/
- export GATSBY_FILE_SUMMARY_API_URL=https://service.integration.explore.data.humancellatlas.org/repository/summary
- export GATSBY_TERM_FACETS_API_URL=https://service.integration.explore.data.humancellatlas.org/repository/projects
- export GATSBY_SYSTEM_HEALTH_CHECK_API_URL=https://status.dev.data.humancellatlas.org/service/dcp-health-check-integration
- export GATSBY_SYSTEM_STATUS_URL=https://status.dev.data.humancellatlas.org/
- export GATSBY_GTM_ID=GTM-M2J5NTJ
- export GATSBY_GTM_AUTH=idWkz24fhkH__F0XXIBNGA
- export GATSBY_ENV_NAME=env-8
- export GATSBY_ENV=INTEGRATION
- gatsby build
only:
- integration
# Staging Build
build_staging:
<<: *build_template
environment:
name: staging
script:
- cd_metadata-schema && git checkout staging
- export GATSBY_EXPLORE_URL=https://staging.data.humancellatlas.org/explore/
- export GATSBY_FILE_SUMMARY_API_URL=https://service.staging.explore.data.humancellatlas.org/repository/summary
- export GATSBY_TERM_FACETS_API_URL=https://service.staging.explore.data.humancellatlas.org/repository/projects
- export GATSBY_SYSTEM_HEALTH_CHECK_API_URL=https://status.dev.data.humancellatlas.org/service/dcp-health-check-staging
- export GATSBY_SYSTEM_STATUS_URL=https://status.dev.data.humancellatlas.org/
- export GATSBY_GTM_ID=GTM-M2J5NTJ
- export GATSBY_GTM_AUTH=CVR6RDnBikpJoyAEnybSBw
- export GATSBY_ENV_NAME=env-10
- export GATSBY_ENV=STAGING
- gatsby build
only:
- staging
########################################
# Deploy Jobs
########################################
# Deploy Job Template
.deploy_template: &deploy_template
stage: deploy
image: python:3.5
before_script:
- pip install awscli
# Dev Deploy
deploy_develop:
<<: *deploy_template
environment:
name: develop
script:
- export BUCKET=s3://dev.data.humancellatlas.org/
- if [ "$MAINTENANCE" = "true" ];then export SRCDIR=maintenance/; else export SRCDIR=public/; fi
- aws s3 sync --acl public-read $SRCDIR $BUCKET --delete
- aws cloudfront create-invalidation --distribution-id EDQUW4UP25O4L --paths "/*"
only:
- develop
# Dev Deploy
deploy_ux-dev:
<<: *deploy_template
environment:
name: ux-dev
script:
- export BUCKET=s3://ux-dev.data.humancellatlas.org/
- if [ "$MAINTENANCE" = "true" ];then export SRCDIR=maintenance/; else export SRCDIR=public/; fi
- aws s3 sync --acl public-read $SRCDIR $BUCKET --delete
- aws cloudfront create-invalidation --distribution-id E3JWRFLK4O8V1L --paths "/*"
only:
- ux-dev
# Integration Deploy
deploy_integration:
<<: *deploy_template
environment:
name: integration
script:
- export BUCKET=s3://integration.data.humancellatlas.org/
- if [ "$MAINTENANCE" = "true" ];then export SRCDIR=maintenance/; else export SRCDIR=public/; fi
- aws s3 sync --acl public-read $SRCDIR $BUCKET --delete
- aws cloudfront create-invalidation --distribution-id E2MB44J9QEJOYP --paths "/*"
only:
- integration
# Staging Deploy
deploy_staging:
<<: *deploy_template
environment:
name: staging
script:
- export BUCKET=s3://staging.data.humancellatlas.org/
- if [ "$MAINTENANCE" = "true" ];then export SRCDIR=maintenance/; else export SRCDIR=public/; fi
- aws s3 sync --acl public-read $SRCDIR $BUCKET --delete
- aws cloudfront create-invalidation --distribution-id E38D6Y96QKYO6 --paths "/*"
only:
- staging