forked from DataBiosphere/data-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.cgl-lower-env.yml
153 lines (139 loc) · 3.84 KB
/
.gitlab-ci.cgl-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
stages:
- test
- build
- deploy
# Build Jobs
# Build Job Template
.build_template: &build_template
image: clevercanary/ng-cli-karma-python3:13.2.5
stage: build
before_script:
- npm -v
- node -v
- cd spa
- npm install
- cd ..
- cd scripts
- npm install
- cd ..
artifacts:
paths:
- dist
- 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 main --max_depth 30 --entropy=False https://github.com/HumanCellAtlas/data-browser.git
except:
- prod
# Test with karma
test_karma:
image: clevercanary/ng-cli-karma-python3:13.2.5
stage: test
script:
- cd spa
- npm install
- ng test --watch=false
except:
- prod
# Develop Build
build_cgl-dev:
<<: *build_template
environment:
name: cgl-dev
script:
- export GTM_ID=GTM-M2J5NTJ
- export GTM_AUTH=CzDpc0__fhyqfREDehPK8Q
- export GTM_ENV=env-83
- pwd
- ./insert-gtm-snippet.sh
- cd spa
- npm run build-cgl-dev
- cd ..
- cd scripts
- npm run update-sitemap -- catalog=dcp32
only:
- main
build_cgl-ux-dev:
<<: *build_template
environment:
name: cgl-ux-dev
script:
- export GTM_ID=GTM-M2J5NTJ
- export GTM_AUTH=CzDpc0__fhyqfREDehPK8Q
- export GTM_ENV=env-83
- pwd
- ./insert-gtm-snippet.sh
- cd spa
- npm run build-cgl-dev
only:
- ux-dev
build_lungmap-dev:
<<: *build_template
environment:
name: lungmap-dev
script:
- export GTM_ID=GTM-M2J5NTJ
- export GTM_AUTH=XOKAlpBSltsrm1PKGR-fow
- export GTM_ENV=env-149
- pwd
- ./insert-gtm-snippet.sh
- cd spa
- npm run build-lungmap-dev
- cd ..
- cd scripts
- npm run update-sitemap -- catalog=lm2
only:
- lungmap-main
########################################
# Deploy Jobs
########################################
# Deploy Job Template
.deploy_template: &deploy_template
stage: deploy
image: python:3.5
before_script:
- pip install awscli
# Dev Deploy
deploy_cgl-dev:
<<: *deploy_template
environment:
name: cgl-dev
script:
- export BUCKET=s3://dev.explore.singlecell.gi.ucsc.edu
- if [ "$MAINTENANCE" = "true" ];then export SRCDIR=maintenance/; else export SRCDIR=dist/; fi
- aws s3 sync $SRCDIR $BUCKET --delete
- aws s3 cp $BUCKET/explore/index.html $BUCKET/explore/index.html --metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html
- aws cloudfront create-invalidation --distribution-id E3562WJBOLN8W8 --paths "/*"
only:
- main
# ux-dev deploy
deploy_cgl-ux-dev:
<<: *deploy_template
environment:
name: cgl-ux-dev
script:
- export BUCKET=s3://ux-dev.explore.singlecell.gi.ucsc.edu
- if [ "$MAINTENANCE" = "true" ];then export SRCDIR=maintenance/; else export SRCDIR=dist/; fi
- aws s3 sync $SRCDIR $BUCKET --delete
- aws s3 cp $BUCKET/explore/index.html $BUCKET/explore/index.html --metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html
- aws cloudfront create-invalidation --distribution-id E3FFK49Z7TQ60R --paths "/*"
only:
- ux-dev
# Lungmap Dev Deploy
deploy_lungmap-dev:
<<: *deploy_template
environment:
name: lungmap-dev
script:
- export BUCKET=s3://dev.explore.lungmap.net
- if [ "$MAINTENANCE" = "true" ];then export SRCDIR=maintenance/; else export SRCDIR=dist/; fi
- aws s3 sync $SRCDIR $BUCKET --delete
- aws s3 cp $BUCKET/explore/index.html $BUCKET/explore/index.html --metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html
- aws cloudfront create-invalidation --distribution-id E21CJFOUWO9Q7X --paths "/*"
only:
- lungmap-main