@@ -148,6 +148,19 @@ done
148
148
149
149
strategy=" $(
150
150
for tag in " ${order[@]} " ; do
151
+ # envObjectToGitHubEnvFileJQ converts from the output of ~/oi/.bin/bashbrew-buildkit-env-setup.sh into what GHA expects in $GITHUB_ENV
152
+ # (in a separate env to make embedding/quoting easier inside this sub-jq that generates JSON that embeds shell scripts)
153
+ envObjectToGitHubEnvFileJQ='
154
+ to_entries | map(
155
+ (.key | if test("[^a-zA-Z0-9_]+") then
156
+ error("invalid env key: \(.)")
157
+ else . end)
158
+ + "="
159
+ + (.value | if test("[\r\n]+") then
160
+ error("invalid env value: \(.)")
161
+ else . end)
162
+ ) | join("\n")
163
+ ' \
151
164
jq -c '
152
165
.meta += {
153
166
froms: (
@@ -176,8 +189,23 @@ strategy="$(
176
189
),
177
190
"git clone --depth 1 https://github.com/docker-library/official-images.git -b master ~/oi",
178
191
179
- # https://github.com/docker-library/bashbrew/pull/43
180
- "echo BASHBREW_BUILDKIT_SYNTAX=\"$(< ~/oi/.bashbrew-buildkit-syntax)\" >> \"$GITHUB_ENV\"",
192
+ (
193
+ "# https://github.com/docker-library/bashbrew/pull/43",
194
+ if ([ .meta.entries[].builder ] | index("buildkit")) then
195
+ # https://github.com/docker-library/bashbrew/pull/70#issuecomment-1461033890 (we need to _not_ set BASHBREW_ARCH here)
196
+ "if [ -x ~/oi/.bin/bashbrew-buildkit-env-setup.sh ]; then",
197
+ "\t# https://github.com/docker-library/official-images/pull/14212",
198
+ "\tbuildkitEnvs=\"$(~/oi/.bin/bashbrew-buildkit-env-setup.sh)\"",
199
+ "\tjq <<<\"$buildkitEnvs\" -r \(env.envObjectToGitHubEnvFileJQ | @sh) | tee -a \"$GITHUB_ENV\"",
200
+ "else",
201
+ "\tBASHBREW_BUILDKIT_SYNTAX=\"$(< ~/oi/.bashbrew-buildkit-syntax)\"; export BASHBREW_BUILDKIT_SYNTAX",
202
+ "\tprintf \"BASHBREW_BUILDKIT_SYNTAX=%q\\n\" \"$BASHBREW_BUILDKIT_SYNTAX\" >> \"$GITHUB_ENV\"",
203
+ "fi",
204
+ empty
205
+ else
206
+ empty
207
+ end
208
+ ),
181
209
182
210
"# create a dummy empty image/layer so we can --filter since= later to get a meaningful image list",
183
211
"{ echo FROM " + (
0 commit comments