Skip to content

Commit 31b0945

Browse files
committed
create cgl lower env gitlab config
1 parent b84853e commit 31b0945

File tree

2 files changed

+97
-4
lines changed

2 files changed

+97
-4
lines changed

.gitlab-ci.cgl-lower-env.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
2+
stages:
3+
- test
4+
- build
5+
- deploy
6+
7+
# Build Jobs
8+
# Build Job Template
9+
.build_template: &build_template
10+
image: node:10.16.0
11+
stage: build
12+
before_script:
13+
- npm -v
14+
- npm install npm@6.9.0 -g
15+
- npm -v
16+
- cd spa
17+
- npm install
18+
- cd ..
19+
20+
artifacts:
21+
paths:
22+
- dist
23+
- maintenance
24+
25+
26+
# Test with Trufflehog
27+
test_trufflehog:
28+
stage: test
29+
image: python:3.5
30+
before_script:
31+
- pip install trufflehog
32+
script:
33+
- trufflehog --regex --rules trufflehog-rules.json --branch develop --max_depth 30 --entropy=False https://github.com/HumanCellAtlas/data-browser.git
34+
except:
35+
- master
36+
37+
# Test with karma
38+
test_karma:
39+
image: trion/ng-cli-karma
40+
stage: test
41+
script:
42+
- cd spa
43+
- npm install
44+
- ng test --watch=false
45+
except:
46+
- master
47+
48+
# Develop Build
49+
build_cgl-dev:
50+
<<: *build_template
51+
environment:
52+
name: cgl-dev
53+
script:
54+
- export GTM_ID=GTM-M2J5NTJ
55+
- export GTM_AUTH=CzDpc0__fhyqfREDehPK8Q
56+
- export GTM_ENV=env-83
57+
- pwd
58+
- ./insert-gtm-snippet.sh
59+
- cd spa
60+
- npm run build-develop
61+
only:
62+
- develop
63+
64+
65+
########################################
66+
# Deploy Jobs
67+
########################################
68+
69+
70+
# Deploy Job Template
71+
.deploy_template: &deploy_template
72+
stage: deploy
73+
image: python:3.5
74+
before_script:
75+
- pip install awscli
76+
77+
# Dev Deploy
78+
deploy_cgl-dev:
79+
<<: *deploy_template
80+
environment:
81+
name: cgl-dev
82+
script:
83+
- export BUCKET=s3://dev.explore.singlecell.gi.ucsc.edu
84+
- if [ "$MAINTENANCE" = "true" ];then export SRCDIR=maintenance/; else export SRCDIR=dist/; fi
85+
- aws s3 sync --acl public-read $SRCDIR $BUCKET --delete
86+
- 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 --acl public-read
87+
- aws cloudfront create-invalidation --distribution-id E3562WJBOLN8W8 --paths "/*"
88+
only:
89+
- develop
90+

cgl-dev-deploy.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
#!/usr/bin/env bash
22

3+
export GATSBY_GTM_ID=GTM-M2J5NTJ
4+
export GATSBY_GTM_AUTH=CzDpc0__fhyqfREDehPK8Q
5+
export GATSBY_ENV_NAME=env-83
6+
7+
38
echo \"Deleting ./dist/\"
49
rm -rf ./dist
5-
cd spa
610

11+
./insert-gtm-snippet.sh
12+
cd spa
713

8-
export GATSBY_GTM_ID=GTM-M2J5NTJ
9-
export GATSBY_GTM_AUTH=CzDpc0__fhyqfREDehPK8Q
10-
export GATSBY_ENV_NAME=env-83
1114

1215
npm run build-cgl-dev
1316
export BUCKET=s3://dev.explore.singlecell.gi.ucsc.edu/

0 commit comments

Comments
 (0)