Skip to content

Commit 9fef35c

Browse files
committed
e2e: test build records export
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent ac1a8ee commit 9fef35c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

hack/test-driver

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ buildxCmd build ${buildPlatformFlag} \
134134
--metadata-file="${context}/metadata-build.json" \
135135
"${context}"
136136
cat "${context}/metadata-build.json"
137+
buildRef=$(awk -F'"' '/"buildx.build.ref"/ {print $4; exit}' "${context}/metadata-build.json")
138+
buildID=${buildRef##*/}
137139

138140
# load to docker store
139141
if [ "$DRIVER" != "docker" ]; then
@@ -143,6 +145,15 @@ if [ "$DRIVER" != "docker" ]; then
143145
"${context}"
144146
fi
145147

148+
# list build records
149+
buildxCmd --builder="${builderName}" history ls
150+
151+
# export build records
152+
buildxCmd --builder="${builderName}" history export --finalize "${buildID}" --output "${context}/record.dockerbuild"
153+
file "${context}/record.dockerbuild"
154+
buildxCmd --builder="${builderName}" history export --finalize --all --output "${context}/records.dockerbuild"
155+
file "${context}/records.dockerbuild"
156+
146157
# create bake def
147158
cat > "${bakedef}" <<EOL
148159
group "default" {

0 commit comments

Comments
 (0)