-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.gitlab-ci.yml
107 lines (98 loc) · 4.85 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
image: node:16.20.2
variables:
APP_PATH: /builds/$CI_PROJECT_PATH
before_script:
- cd $APP_PATH
stages:
- build
- deploy
dist:staging:
stage: build
environment: staging
only:
- master
artifacts:
name: "canwork-webui dist"
paths:
- $APP_PATH/dist
script:
- yarn
- echo -n "+ current working path:" && pwd
- echo "ANGULAR ENV STUB" >> $APP_PATH/src/environments/environment.ts
- echo $ENVIRONMENT_STAGING >> $APP_PATH/src/environments/environment.staging.ts
- yarn run build:staging
dist:production:
stage: build
environment: production
only:
- master
artifacts:
name: "canwork-webui dist"
paths:
- $APP_PATH/dist
script:
- yarn
- echo -n "+ current working path:" && pwd
- echo "ANGULAR ENV STUB" >> $APP_PATH/src/environments/environment.ts
- echo $ENVIRONMENT_PROD >> $APP_PATH/src/environments/environment.prod.ts
- yarn run build:prod
deploy:staging:
# this job keeps for now the old version of node and firebase tools
stage: deploy
environment: staging
only:
- master
dependencies:
- dist:staging
script:
- cd $APP_PATH/functions
- yarn
- npm install -g firebase-tools@11.30.0
- firebase --version
- cd ..
- firebase use staging --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set algolia.appid="$FIREBASE_ALGOLIA_APPID" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set algolia.apikey="$FIREBASE_ALGOLIA_APIKEY_STAGING" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set algolia.providerindex="$FIREBASE_ALGOLIA_STAGINGINDEX" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set sendgrid.apikey="$FIREBASE_SENDGRID_APIKEY" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set fbadmin.project_id="$FIREBASE_PROJECT_ID_STAGING" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set fbadmin.client_email="$FIREBASE_CLIENT_EMAIL_STAGING" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set fbadmin.private_key="$FIREBASE_PRIVATE_KEY_STAGING" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set fbadmin.database_url="$FIREBASE_DATABASE_URL_STAGING" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set fbadmin.storage_bucket="$FIREBASE_STORAGE_BUCKET_STAGING" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set dev.authkey="$FIREBASE_DEV_AUTHKEY" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set internal.authkey="$FIREBASE_INTERNAL_AUTHKEY" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set chainmonitor.authkey="$CHAINMONITOR_AUTHKEY" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set chainmonitor.bsctokens="$CHAINMONITOR_BSCTOKENS" --token "$FIREBASE_CI_AUTH_TOKEN"
- echo "Deploying"
- firebase deploy --token "$FIREBASE_CI_AUTH_TOKEN" -P $FIREBASE_PROJECT_ID_STAGING --only hosting:canwork-webui
deploy:production:
stage: deploy
environment: production
only:
- master
when: manual
dependencies:
- dist:production
script:
- cd $APP_PATH/functions
- yarn
- npm install -g firebase-tools@11.30.0
- firebase --version
- cd ..
- firebase use prod --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set algolia.appid="$FIREBASE_ALGOLIA_APPID" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set algolia.apikey="$FIREBASE_ALGOLIA_APIKEY_PROD" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set algolia.providerindex="$FIREBASE_ALGOLIA_PROVIDERINDEX" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set sendgrid.apikey="$FIREBASE_SENDGRID_APIKEY" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set fbadmin.project_id="$FIREBASE_PROJECT_ID" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set fbadmin.client_email="$FIREBASE_CLIENT_EMAIL" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set fbadmin.private_key="$FIREBASE_PRIVATE_KEY" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set fbadmin.database_url="$FIREBASE_DATABASE_URL" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set fbadmin.storage_bucket="$FIREBASE_STORAGE_BUCKET" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set dev.authkey="$FIREBASE_DEV_AUTHKEY" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set internal.authkey="$FIREBASE_INTERNAL_AUTHKEY" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set chainmonitor.authkey="$CHAINMONITOR_AUTHKEY" --token "$FIREBASE_CI_AUTH_TOKEN"
- firebase functions:config:set chainmonitor.bsctokens="$CHAINMONITOR_BSCTOKENS" --token "$FIREBASE_CI_AUTH_TOKEN"
- echo "Deploying"
- firebase deploy --token "$FIREBASE_CI_AUTH_TOKEN" -P $FIREBASE_PROJECT_ID --only hosting:canwork-webui