Skip to content

Commit bddff63

Browse files
committed
cmd-build-with-buildah: update meta.json with pkg/advisory diffs
This used to be done in the cmd-build path and some things depend on it, so let's add it back here. This also prints a diff so we'll see it in the logs in the pipeline, which can be useful.
1 parent 18a3c9f commit bddff63

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/cmd-build-with-buildah

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ while true; do
6969
;;
7070
--parent-build)
7171
shift
72+
PARENT_BUILD=$1
7273
;;
7374
--force)
7475
FORCE=1
@@ -232,6 +233,19 @@ build_with_buildah() {
232233
/usr/lib/coreos-assembler/cmd-import "${final_ref}" ${SKIP_PRUNE:+--skip-prune}
233234
fi
234235

236+
# For the logs, print the RPM diff
237+
/usr/lib/coreos-assembler/cmd-diff --rpms \
238+
--to=${VERSION} ${PARENT_BUILD:+--from=$PARENT_BUILD}
239+
240+
# For meta.json let's record the RPM diff and advisory diff information
241+
/usr/lib/coreos-assembler/cmd-diff --rpms-json \
242+
--to=${VERSION} ${PARENT_BUILD:+--from=$PARENT_BUILD} |
243+
jq '{"pkgdiff": .pkgdiff, "advisories-diff": .advisories}' > ${tempdir}/diff.json
244+
/usr/lib/coreos-assembler/cmd-meta --build=${VERSION} \
245+
--skip-validation --artifact-json ${tempdir}/diff.json
246+
# Run a 'dump' now to perform schema validation since we skipped it above.
247+
/usr/lib/coreos-assembler/cmd-meta --dump --build=${VERSION} > /dev/null
248+
235249
rm -rf "${tempdir}"
236250
}
237251

0 commit comments

Comments
 (0)