From e2d78039bc847ad6230caa0fe1b4658e7e9690b2 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Fri, 8 Nov 2019 13:50:36 +0100 Subject: Send a copy of repo manifest through garage-push Signed-off-by: Laurent Bonnans --- classes/image_types_ostree.bbclass | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'classes/image_types_ostree.bbclass') diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 0e047b1..f10e523 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -186,13 +186,19 @@ IMAGE_CMD_ostreecommit () { IMAGE_TYPEDEP_ostreepush = "ostreecommit" do_image_ostreepush[depends] += "aktualizr-native:do_populate_sysroot ca-certificates-native:do_populate_sysroot" IMAGE_CMD_ostreepush () { - # Print warnings if credetials are not set or if the file has not been found. + # send a copy of the repo manifest to backend if available + local SEND_MANIFEST="" + if [ -f ${IMAGE_ROOTFS}${sysconfdir}/manifest.xml ]; then + SEND_MANIFEST="--repo-manifest ${IMAGE_ROOTFS}${sysconfdir}/manifest.xml" + fi + if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then garage-push -vv --repo=${OSTREE_REPO} \ --ref=${OSTREE_BRANCHNAME} \ --credentials=${SOTA_PACKED_CREDENTIALS} \ - --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt + --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt \ + $SEND_MANIFEST else bbwarn "SOTA_PACKED_CREDENTIALS file does not exist." fi -- cgit v1.2.3-54-g00ecf From 82c41c269eccb87c297de0199f8d996f7da3866d Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Mon, 11 Nov 2019 17:26:26 +0100 Subject: Only push repo manifest if garage-push supports it Signed-off-by: Laurent Bonnans --- classes/image_types_ostree.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'classes/image_types_ostree.bbclass') diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index f10e523..0f0fd28 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -188,7 +188,8 @@ do_image_ostreepush[depends] += "aktualizr-native:do_populate_sysroot ca-certifi IMAGE_CMD_ostreepush () { # send a copy of the repo manifest to backend if available local SEND_MANIFEST="" - if [ -f ${IMAGE_ROOTFS}${sysconfdir}/manifest.xml ]; then + # check if garage-push supports the --repo-manifest option before trying + if $(garage-push --help | grep -q '^\s*--repo-manifest') && [ -f ${IMAGE_ROOTFS}${sysconfdir}/manifest.xml ]; then SEND_MANIFEST="--repo-manifest ${IMAGE_ROOTFS}${sysconfdir}/manifest.xml" fi -- cgit v1.2.3-54-g00ecf