forked from GoogleCloudPlatform/php-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild-ubuntu.yaml
181 lines (165 loc) · 7.47 KB
/
cloudbuild-ubuntu.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
steps:
# test network for making local docker http requests
- name: gcr.io/cloud-builders/docker
args: ['network', 'create', '-d', 'bridge', 'nw_$_TAG']
waitFor: ['-']
id: test-network
# grab gcp-php packages from GCS
- name: google/cloud-sdk:252.0.0-slim
args: ['gsutil', '-m', 'cp', '-r', 'gs://gcp-php-packages/$_RUNTIME_DISTRIBUTION', '/workspace/php-base']
waitFor: ['-']
id: gsutil
# php-base
- name: gcr.io/cloud-builders/docker
args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php-base:$_TAG', '--build-arg', 'RUNTIME_DISTRIBUTION=$_RUNTIME_DISTRIBUTION', '.']
dir: php-base
waitFor: ['gsutil']
id: php-base
- name: gcr.io/gcp-runtimes/structure_test
args: ['-i', 'gcr.io/${_GOOGLE_PROJECT_ID}/php-base:$_TAG', '--config', '/workspace/php-base/php-base.yaml', '-v']
waitFor: ['php-base']
id: php-base-structure
# php72
- name: gcr.io/cloud-builders/docker
args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php72:$_TAG', '--build-arg', 'PHP_VERSION=7.2', '.']
dir: php-versioned
waitFor: ['php-base']
id: php72
- name: gcr.io/gcp-runtimes/structure_test
args: ['-i', 'gcr.io/${_GOOGLE_PROJECT_ID}/php72:$_TAG', '--config', '/workspace/php-versioned/php72.yaml', '-v']
waitFor: ['php72']
id: php72-structure
# php71
- name: gcr.io/cloud-builders/docker
args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php71:$_TAG', '--build-arg', 'PHP_VERSION=7.1', '.']
dir: php-versioned
waitFor: ['php-base']
id: php71
- name: gcr.io/gcp-runtimes/structure_test
args: ['-i', 'gcr.io/${_GOOGLE_PROJECT_ID}/php71:$_TAG', '--config', '/workspace/php-versioned/php71.yaml', '-v']
waitFor: ['php71']
id: php71-structure
# test runner
- name: gcr.io/cloud-builders/docker
args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php-test-runner:$_TAG', '.']
dir: cloudbuild-test-runner
waitFor: ['php71-structure']
id: test-runner
# base tests
- name: gcr.io/cloud-builders/docker
args: ['run', '-v', '/workspace/php-base:/workspace', 'gcr.io/${_GOOGLE_PROJECT_ID}/php-test-runner:$_TAG']
id: php-base-tests
waitFor: ['test-runner', 'php-base']
# php-onbuild
- name: gcr.io/cloud-builders/docker
args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php:$_TAG', '.']
dir: php-onbuild
waitFor: ['php71']
id: php-onbuild
- name: gcr.io/gcp-runtimes/structure_test
args: ['-i', 'gcr.io/${_GOOGLE_PROJECT_ID}/php:$_TAG', '--config', '/workspace/php-onbuild/php.yaml', '-v']
waitFor: ['php-onbuild']
id: php-onbuild-structure
# gen-dockerfile
- name: gcr.io/cloud-builders/docker
args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php/gen-dockerfile:$_TAG', '.']
dir: builder/gen-dockerfile
waitFor: ['php-onbuild']
id: gen-dockerfile
- name: gcr.io/cloud-builders/docker
args: ['run', '-v', '/workspace/builder/gen-dockerfile:/workspace', 'gcr.io/${_GOOGLE_PROJECT_ID}/php-test-runner:$_TAG']
waitFor: ['test-runner']
- name: gcr.io/${_GOOGLE_PROJECT_ID}/php/gen-dockerfile:$_TAG
args: ['--workspace', '/workspace/testapps/builder_test', '--php71-image', 'gcr.io/${_GOOGLE_PROJECT_ID}/php71:$_TAG']
waitFor: ['gen-dockerfile']
id: gen-dockerfile-run
- name: gcr.io/cloud-builders/docker
args: ['run', '-v', '/workspace/testapps/builder_test:/workspace', 'gcr.io/${_GOOGLE_PROJECT_ID}/php-test-runner:$_TAG']
waitFor: ['gen-dockerfile-run', 'test-runner']
id: gen-dockerfile-test
# php-default test
- name: gcr.io/cloud-builders/docker
args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php-default:$_TAG', '.']
dir: testapps/php_default
waitFor: ['php-onbuild']
id: php-default-build
- name: gcr.io/gcp-runtimes/structure_test
args: ['-i', 'gcr.io/${_GOOGLE_PROJECT_ID}/php-default:$_TAG', '--config', 'php_default.yaml', '-v']
waitFor: ['php-default-build']
id: php-default-test
# php71-custom test
- name: gcr.io/cloud-builders/docker
args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php71-custom:$_TAG', '.']
dir: testapps/php71_custom
waitFor: ['php-onbuild']
id: php71-custom-build
- name: gcr.io/gcp-runtimes/structure_test
args: ['-i', 'gcr.io/${_GOOGLE_PROJECT_ID}/php71-custom:$_TAG', '--config', 'php71.yaml', '-v']
waitFor: ['php71-custom-build']
- name: gcr.io/cloud-builders/docker
args: ['run', '--net=nw_$_TAG', '--name=php71-custom', '-d', 'gcr.io/${_GOOGLE_PROJECT_ID}/php71-custom:$_TAG']
waitFor: ['php71-custom-build', 'test-network']
id: php71-custom-app
- name: gcr.io/cloud-builders/docker
args: ['run', '--net=nw_$_TAG','-v', '/workspace:/workspace', 'gcr.io/${_GOOGLE_PROJECT_ID}/php-test-runner:$_TAG', '/workspace/testapps/php71_custom/tests']
waitFor: ['php71-custom-app', 'test-runner']
id: php71-custom-test
# php72-custom test
- name: gcr.io/cloud-builders/docker
args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php72-custom:$_TAG', '.']
dir: testapps/php72_custom
waitFor: ['php-onbuild']
id: php72-custom-build
- name: gcr.io/gcp-runtimes/structure_test
args: ['-i', 'gcr.io/${_GOOGLE_PROJECT_ID}/php72-custom:$_TAG', '--config', 'php72.yaml', '-v']
waitFor: ['php72-custom-build']
- name: gcr.io/cloud-builders/docker
args: ['run', '--net=nw_$_TAG', '--name=php72-custom', '-d', 'gcr.io/${_GOOGLE_PROJECT_ID}/php72-custom:$_TAG']
waitFor: ['php72-custom-build', 'test-network']
id: php72-custom-app
- name: gcr.io/cloud-builders/docker
args: ['run', '--net=nw_$_TAG','-v', '/workspace:/workspace', 'gcr.io/${_GOOGLE_PROJECT_ID}/php-test-runner:$_TAG', '/workspace/testapps/php72_custom/tests']
waitFor: ['php72-custom-app', 'test-runner']
id: php72-custom-test
# php71-extensions test
- name: gcr.io/cloud-builders/docker
args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php71-extensions:$_TAG', '.']
dir: testapps/php71_extensions
waitFor: ['php-onbuild']
id: php71-extensions-build
- name: gcr.io/cloud-builders/docker
args: ['run', 'gcr.io/${_GOOGLE_PROJECT_ID}/php71-extensions:$_TAG', 'vendor/bin/phpunit']
dir: testapps/php71_extensions
waitFor: ['php71-extensions-build']
id: php71-extensions-test
# php72-extensions test
- name: gcr.io/cloud-builders/docker
args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php72-extensions:$_TAG', '.']
dir: testapps/php72_extensions
waitFor: ['php-onbuild']
id: php72-extensions-build
- name: gcr.io/cloud-builders/docker
args: ['run', 'gcr.io/${_GOOGLE_PROJECT_ID}/php72-extensions:$_TAG', 'vendor/bin/phpunit']
dir: testapps/php72_extensions
waitFor: ['php72-extensions-build']
id: php72-extensions-test
# php72-extensions-legacy test
- name: gcr.io/cloud-builders/docker
args: ['build', '-t', 'gcr.io/${_GOOGLE_PROJECT_ID}/php72-extensions:$_TAG', '.']
dir: testapps/php72_extensions_legacy
waitFor: ['php-onbuild']
id: php72-extensions-legacy-build
- name: gcr.io/cloud-builders/docker
args: ['run', 'gcr.io/${_GOOGLE_PROJECT_ID}/php72-extensions:$_TAG', 'vendor/bin/phpunit']
dir: testapps/php72_extensions_legacy
waitFor: ['php72-extensions-build']
id: php72-extensions-legacy-test
images:
- gcr.io/${_GOOGLE_PROJECT_ID}/php-base:$_TAG
- gcr.io/${_GOOGLE_PROJECT_ID}/php:$_TAG
- gcr.io/${_GOOGLE_PROJECT_ID}/php72:$_TAG
- gcr.io/${_GOOGLE_PROJECT_ID}/php71:$_TAG
- gcr.io/${_GOOGLE_PROJECT_ID}/php/gen-dockerfile:$_TAG
- gcr.io/${_GOOGLE_PROJECT_ID}/php-test-runner:$_TAG
options:
machineType: 'N1_HIGHCPU_8'