From e8b160fa85faa996d0b9893f5c6cc67a5d70a2a5 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Wed, 2 Aug 2017 12:33:06 +0200 Subject: [PATCH] Create containerinfo for fissile builds --- Build/Docker.pm | 3 ++- build-recipe-fissile | 19 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Build/Docker.pm b/Build/Docker.pm index ff2d7ae8b..0cceac7ca 100644 --- a/Build/Docker.pm +++ b/Build/Docker.pm @@ -119,7 +119,8 @@ sub parse { sub showcontainerinfo { my ($fn, $image, $taglist, $annotationfile) = @ARGV; local $Build::Kiwi::urlmapper = sub { return $_[0] }; - my $d = parse({}, $fn); + my $d = {}; + $d = parse({}, $fn) if $fn; die("$d->{'error'}\n") if $d->{'error'}; $image =~ s/.*\/// if defined $image; my @tags = split(' ', $taglist); diff --git a/build-recipe-fissile b/build-recipe-fissile index 81cd43bd8..580e0e126 100644 --- a/build-recipe-fissile +++ b/build-recipe-fissile @@ -98,12 +98,12 @@ recipe_build_fissile() { echo "Building packages with fissile" if ! chroot $BUILD_ROOT /bin/bash -c "cd $TOPDIR/SOURCES/release && . .envrc && fissile build packages"; then - cleanup_and_exit 1 "fissile build packages failed" + cleanup_and_exit 1 "fissile build packages failed" fi echo "Building images with fissile" if ! chroot $BUILD_ROOT /bin/bash -c "cd $TOPDIR/SOURCES/release && . .envrc && fissile build images"; then - cleanup_and_exit 1 "fissile build images failed" + cleanup_and_exit 1 "fissile build images failed" fi # Save the resulting images to tarballs. @@ -111,16 +111,15 @@ recipe_build_fissile() { non_built_images=$(perl -MYAML::XS -e "print join('|', @{YAML::XS::LoadFile('$BUILD_ROOT$TOPDIR/SOURCES/fissile.yml')->{'DockerImageDeps'}})") for image in $(chroot $BUILD_ROOT docker images --format "{{.Repository}}:{{.Tag}}" | grep -v $non_built_images); do - echo "Saving image $image" - filename=$(echo $image | sed 's/\//_/g') - if ! chroot $BUILD_ROOT docker save --output "$TOPDIR/FISSILE/$filename.tar" $image ; then - cleanup_and_exit 1 "Docker save command failed" - fi + echo "Saving image $image" + filename=$(echo $image | sed 's/\//_/g') + if ! chroot $BUILD_ROOT docker save --output "$TOPDIR/FISSILE/$filename.tar" "$image" ; then + cleanup_and_exit 1 "Docker save command failed" + fi + # Create containerinfo + perl -I$BUILD_DIR -MBuild::Docker -e Build::Docker::showcontainerinfo '' "$filename.tar" "$image" containers/annotation> "$BUILD_ROOT$TOPDIR/FISSILE/$filename.containerinfo" done - # Create containerinfo - # perl -I$BUILD_DIR -MBuild::Docker -e Build::Docker::showcontainerinfo "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" "$FILENAME.tar" "$IMAGE_NAME:$TAG" containers/annotation> "$BUILD_ROOT$TOPDIR/FISSILE/$FILENAME.containerinfo" - recipe_cleanup_fissile BUILD_SUCCEEDED=true