@@ -10,12 +10,17 @@ TEST_RES_DIR='tools/src/test/resources'
10
10
11
11
REMOTE=" https://github.com/${GITHUB_REPOSITORY:- CycloneDX/ specification} .git"
12
12
13
- BUF_IMAGE_VERSION=' 1.46 .0'
14
-
13
+ BUF_IMAGE_VERSION=' 1.50 .0'
14
+ BUF_IMAGE= " bufbuild/buf: $BUF_IMAGE_VERSION "
15
15
16
16
# # ----
17
17
18
18
19
+ function prepare () {
20
+ docker pull " $BUF_IMAGE "
21
+ }
22
+
23
+
19
24
function schema-lint () {
20
25
echo ' > lint schema files' >&2
21
26
@@ -30,7 +35,7 @@ function schema-lint () {
30
35
--volume " ${ROOT_PATH} /${SCHEMA_DIR} :/workspace/${SCHEMA_DIR} :ro" \
31
36
--volume " ${THIS_PATH} /buf_lint.yaml:/workspace/buf.yaml:ro" \
32
37
--workdir ' /workspace' \
33
- bufbuild/buf: " $BUF_IMAGE_VERSION " \
38
+ " $BUF_IMAGE " \
34
39
lint --path " $SCHEMA_DIR " \
35
40
--error-format " $LOG_FORMAT "
36
41
@@ -66,7 +71,7 @@ function schema-breaking-version () {
66
71
--volume " ${NEW_NP} :/workspaces/new/${SCHEMA_DIR} /${NEW} :ro" \
67
72
--volume " ${THIS_PATH} /buf_breaking-version.yaml:/workspaces/new/buf.yaml:ro" \
68
73
--workdir ' /workspaces/new' \
69
- bufbuild/buf: " $BUF_IMAGE_VERSION " \
74
+ " $BUF_IMAGE " \
70
75
breaking \
71
76
--against ../old \
72
77
--error-format " $LOG_FORMAT "
@@ -93,7 +98,7 @@ function schema-breaking-remote () {
93
98
--volume " ${ROOT_PATH} /${SCHEMA_DIR} :/workspace/${SCHEMA_DIR} :ro" \
94
99
--volume " ${THIS_PATH} /buf_breaking-remote.yaml:/workspace/buf.yaml:ro" \
95
100
--workdir ' /workspace' \
96
- bufbuild/buf: " $BUF_IMAGE_VERSION " \
101
+ " $BUF_IMAGE " \
97
102
breaking --path " $SCHEMA_DIR " \
98
103
--against " ${REMOTE} " \
99
104
--error-format " $LOG_FORMAT "
@@ -118,7 +123,7 @@ function schema-functional () {
118
123
--volume " ${ROOT_PATH} /${SCHEMA_DIR} :/workspace/${SCHEMA_DIR} :ro" \
119
124
--volume " ${FILE} :/workspace/test_res:ro" \
120
125
--workdir ' /workspace' \
121
- bufbuild/buf: " $BUF_IMAGE_VERSION " \
126
+ " $BUF_IMAGE " \
122
127
convert " ${SCHEMA_DIR} /${SCHEMA_FILE} " \
123
128
--type " $MESSAGE " \
124
129
--from ' test_res#format=txtpb' \
@@ -141,23 +146,29 @@ function schema-functional () {
141
146
142
147
case " ${1:- all} " in
143
148
' schema-lint' )
149
+ prepare
144
150
schema-lint
145
151
;;
146
152
' schema-breaking-version' )
153
+ prepare
147
154
schema-breaking-version
148
155
;;
149
156
' schema-breaking-remote' )
157
+ prepare
150
158
schema-breaking-remote
151
159
;;
152
160
' schema-breaking' )
161
+ prepare
153
162
schema-breaking-version
154
163
schema-breaking-remote
155
164
;;
156
165
' schema-functional' )
166
+ prepare
157
167
schema-functional
158
168
;;
159
169
' all' )
160
170
# all the above
171
+ prepare
161
172
schema-lint
162
173
schema-breaking-version
163
174
schema-breaking-remote
0 commit comments