-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
74 lines (74 loc) · 2.49 KB
/
cloudbuild.yaml
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
timeout: '3600s'
steps:
# Backend
# Install backend packages
- name: node:$_NODE_VERSION
entrypoint: yarn
args: ['install']
dir: 'packages/backend'
# Create backend .env
- name: node:$_NODE_VERSION
entrypoint: yarn
args: ['run', 'create-env']
env:
- 'CLIENT_TOKEN_SECRET=${_CLIENT_TOKEN_SECRET}'
- 'MONGODB_CONNECTION_URL=${_MONGODB_CONNECTION_URL}'
- 'SERVICE_URL=${_SERVICE_URL}'
- 'DEV_PORT=${_DEV_PORT}'
- 'ALLOWED_ORIGINS=${_ALLOWED_ORIGINS}'
- 'CAS_VALIDATE_URL=${_CAS_VALIDATE_URL}'
- 'COLLEGES=${_COLLEGES}'
- 'MAJORS=${_MAJORS}'
- 'MINORS=${_MINORS}'
- 'NODE_ENV=${_NODE_ENV}'
- 'TOKEN_EXPIRE_TIME=${_TOKEN_EXPIRE_TIME}'
- 'MAX_REPORTS=${_MAX_REPORTS}'
- 'AWS_ACCESS_KEY_ID=${_AWS_ACCESS_KEY_ID}'
- 'AWS_SECRET_ACCESS_KEY=${_AWS_SECRET_ACCESS_KEY}'
- 'BUCKET=${_BUCKET}'
- 'REGION=${_REGION}'
- 'REDISHOST=${_REDISHOST}'
- 'REDISPORT=${_REDISPORT}'
dir: 'packages/backend'
# Build the backend
- name: node:$_NODE_VERSION
entrypoint: yarn
args: ['run', 'build']
dir: 'packages/backend'
# Deploy the backend to App Engine Flex
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', "-v", "$_GAE_VERSION"]
timeout: '1800s'
dir: 'packages/backend'
# Frontend
# Install frontend packages
- name: node:$_NODE_VERSION
entrypoint: yarn
args: ['install']
dir: 'packages/frontend'
# Create frontend .env
- name: node:$_NODE_VERSION
entrypoint: yarn
args: ['run', 'create-env']
env:
- 'REACT_APP_IDP_LOGOUT_URL=${_REACT_APP_IDP_LOGOUT_URL}'
- 'REACT_APP_SERVICE_URL=${_REACT_APP_SERVICE_URL}'
- 'REACT_APP_CAS_AUTH_URL=${_REACT_APP_CAS_AUTH_URL}'
- 'REACT_APP_BACKEND_AUTH_URL=${_REACT_APP_BACKEND_AUTH_URL}'
- 'REACT_APP_GQL_URL=${_REACT_APP_GQL_URL}'
- 'REACT_APP_WS_URL=${_REACT_APP_WS_URL}'
- 'REACT_APP_TOKEN_NAME=${_REACT_APP_TOKEN_NAME}'
dir: 'packages/frontend'
# Build the frontend
- name: node:$_NODE_VERSION
entrypoint: yarn
args: ['run', 'build']
dir: 'packages/frontend'
# Deploy the frontend to App Engine
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', "-v", "$_GAE_VERSION"]
timeout: '1800s'
dir: 'packages/frontend'
# Set the traffic for the production version of the frontend
- name: "gcr.io/cloud-builders/gcloud"
args: ["app", "services", "--project", "$PROJECT_ID", "set-traffic", "--splits", "$_GAE_TRAFFIC"]