Skip to content

Commit ba2f865

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

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jobs:
153153
-
154154
name: Install k3s
155155
if: matrix.driver == 'kubernetes'
156-
uses: crazy-max/.github/.github/actions/install-k3s@7730d1434364d4b9aded32735b078a7ace5ea79a
156+
uses: crazy-max/.github/.github/actions/install-k3s@a94383ec9e125b23907fb6fcebf7ff87964595e5
157157
with:
158158
version: ${{ env.K3S_VERSION }}
159159
-

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)