forked from DataBiosphere/data-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.prod-env.yml
82 lines (73 loc) · 2.3 KB
/
.gitlab-ci.prod-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
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/metadata-schema.git _metadata-schema
- git clone https://github.com/HumanCellAtlas/humancellatlas.github.io
- 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
only:
- master
# Develop Build
build_master:
<<: *build_template
environment:
name: prod
script:
- export GATSBY_EXPLORE_URL=https://data.humancellatlas.org/explore/
- export GATSBY_FILE_SUMMARY_API_URL=https://service.explore.data.humancellatlas.org/repository/summary
- export GATSBY_TERM_FACETS_API_URL=https://service.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=xm3qglWPEFim7Lb4AxXnsA
- export GATSBY_ENV_NAME=env-2
- export GATSBY_ENV=PROD
- gatsby build
only:
- master
########################################
# Deploy Jobs
########################################
# Deploy Job Template
.deploy_template: &deploy_template
stage: deploy
image: python:3.5
before_script:
- pip install awscli
# Prod Deploy
deploy_master:
<<: *deploy_template
environment:
name: prod
script:
- export BUCKET=s3://org-humancellatlas-data-portal-prod/
- 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 E3QDNPF7XH7O7G --paths "/*"
only:
- master