This repository has been archived by the owner on Jun 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
cloudbuild.yaml
127 lines (125 loc) · 4.43 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
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
steps:
# Push production image to GCR
- name: 'gcr.io/cloud-builders/docker'
args:
[
'build',
'--build-arg',
'PUBLIC_URL=${_PUBLIC_URL}',
'--build-arg',
'LITERALS_FILE=${_LITERALS_FILE}',
'--build-arg',
'DEFAULT_WORKSPACE=${_DEFAULT_WORKSPACE}',
'--build-arg',
'REACT_APP_FEATURE_FLAG_SUBSCRIPTIONS=${_REACT_APP_FEATURE_FLAG_SUBSCRIPTIONS}',
'--build-arg',
'REACT_APP_FEATURE_TRANSLATIONS=${_REACT_APP_FEATURE_TRANSLATIONS}',
'--build-arg',
'REACT_APP_COMPLETE_MAP_RENDER=${_REACT_APP_COMPLETE_MAP_RENDER}',
'--build-arg',
'REACT_APP_DISABLE_WELCOME_MODAL=${_REACT_APP_DISABLE_WELCOME_MODAL}',
'--build-arg',
'REACT_APP_REQUIRE_MAP_LOGIN=${_REACT_APP_REQUIRE_MAP_LOGIN}',
'--build-arg',
'REACT_APP_SHOW_BANNER=${_REACT_APP_SHOW_BANNER}',
'--build-arg',
'REACT_APP_WELCOME_MODAL_COOKIE_KEY=${_REACT_APP_WELCOME_MODAL_COOKIE_KEY}',
'--build-arg',
'REACT_APP_TIMEBAR_DATA_URL=${_REACT_APP_TIMEBAR_DATA_URL}',
'--build-arg',
'REACT_APP_API_GATEWAY=${_REACT_APP_API_GATEWAY}',
'--build-arg',
'REACT_APP_SITE_URL=${_REACT_APP_SITE_URL}',
'--build-arg',
'REACT_APP_MAP_URL=${_REACT_APP_MAP_URL}',
'--build-arg',
'REACT_APP_SHARE_BASE_URL=${_REACT_APP_SHARE_BASE_URL}',
'--build-arg',
'REACT_APP_GOOGLE_TAG_MANAGER_KEY=${_REACT_APP_GOOGLE_TAG_MANAGER_KEY}',
'--build-arg',
'BASIC_AUTH_USER=$_BASIC_AUTH_USER',
'--build-arg',
'BASIC_AUTH_PASS=$_BASIC_AUTH_PASS',
'--target',
'build',
'-t',
'gcr.io/world-fishing-827/github.com/globalfishingwatch/map-client:$COMMIT_SHA',
'.',
]
- name: 'gcr.io/cloud-builders/docker'
args:
[
'run',
'gcr.io/world-fishing-827/github.com/globalfishingwatch/map-client:$COMMIT_SHA',
'npm',
'test',
]
- name: 'gcr.io/cloud-builders/docker'
args:
[
'build',
'--build-arg',
'PUBLIC_URL=${_PUBLIC_URL}',
'--build-arg',
'LITERALS_FILE=${_LITERALS_FILE}',
'--build-arg',
'DEFAULT_WORKSPACE=${_DEFAULT_WORKSPACE}',
'--build-arg',
'REACT_APP_FEATURE_FLAG_SUBSCRIPTIONS=${_REACT_APP_FEATURE_FLAG_SUBSCRIPTIONS}',
'--build-arg',
'REACT_APP_FEATURE_TRANSLATIONS=${_REACT_APP_FEATURE_TRANSLATIONS}',
'--build-arg',
'REACT_APP_COMPLETE_MAP_RENDER=${_REACT_APP_COMPLETE_MAP_RENDER}',
'--build-arg',
'REACT_APP_DISABLE_WELCOME_MODAL=${_REACT_APP_DISABLE_WELCOME_MODAL}',
'--build-arg',
'REACT_APP_REQUIRE_MAP_LOGIN=${_REACT_APP_REQUIRE_MAP_LOGIN}',
'--build-arg',
'REACT_APP_SHOW_BANNER=${_REACT_APP_SHOW_BANNER}',
'--build-arg',
'REACT_APP_WELCOME_MODAL_COOKIE_KEY=${_REACT_APP_WELCOME_MODAL_COOKIE_KEY}',
'--build-arg',
'REACT_APP_TIMEBAR_DATA_URL=${_REACT_APP_TIMEBAR_DATA_URL}',
'--build-arg',
'REACT_APP_API_GATEWAY=${_REACT_APP_API_GATEWAY}',
'--build-arg',
'REACT_APP_SITE_URL=${_REACT_APP_SITE_URL}',
'--build-arg',
'REACT_APP_MAP_URL=${_REACT_APP_MAP_URL}',
'--build-arg',
'REACT_APP_SHARE_BASE_URL=${_REACT_APP_SHARE_BASE_URL}',
'--build-arg',
'REACT_APP_GOOGLE_TAG_MANAGER_KEY=${_REACT_APP_GOOGLE_TAG_MANAGER_KEY}',
'--build-arg',
'BASIC_AUTH_USER=$_BASIC_AUTH_USER',
'--build-arg',
'BASIC_AUTH_PASS=$_BASIC_AUTH_PASS',
'-t',
'gcr.io/world-fishing-827/github.com/globalfishingwatch/map-client:$COMMIT_SHA',
'.',
]
- name: 'gcr.io/cloud-builders/docker'
args:
['push', 'gcr.io/world-fishing-827/github.com/globalfishingwatch/map-client:$COMMIT_SHA']
# Deploy to the appropriate environment
- name: 'gcr.io/cloud-builders/gcloud'
args:
[
'beta',
'run',
'deploy',
'$_RUN_SERVICE_NAME',
'--project',
'$_RUN_PROJECT',
'--image',
'gcr.io/world-fishing-827/github.com/globalfishingwatch/map-client:$COMMIT_SHA',
'--region',
'$_RUN_REGION',
'--platform',
'managed',
'--set-env-vars',
'BASIC_AUTH=$_BASIC_AUTH',
'--allow-unauthenticated',
]
images:
- 'gcr.io/world-fishing-827/github.com/globalfishingwatch/map-client:$COMMIT_SHA'