diff --git a/builder/build-image.sh b/builder/build-image.sh index 7244424..4a36770 100755 --- a/builder/build-image.sh +++ b/builder/build-image.sh @@ -29,15 +29,21 @@ packer plugins install github.com/hashicorp/ansible # do the build if tools/build.sh "$IMAGE" >/var/log/image-build.log 2>&1; then - builder/refresh.sh vo.access.egi.eu "$(cat /var/tmp/egi/.refresh_token)" images - OS_TOKEN="$(yq -r '.clouds.images.auth.token' /etc/openstack/clouds.yaml)" + # compress the resulting image VM_NAME="$(jq -r ".builders[].vm_name" < "$IMAGE")" cd "$(dirname "$IMAGE")/output-qemu" - SHA="$(sha512sum -z "$VM_NAME" | cut -f1 -d" ")" - openstack --os-cloud images --os-token "$OS_TOKEN" \ - object create egi_endorsed_vas \ - "$VM_NAME" >>/var/log/image-build.log - echo "SUCCESSFUL BUILD - $VM_NAME - $SHA" >>/var/log/image-build.log + QCOW_FILE="$VM_NAME.qcow2" + qemu-img convert -O qcow2 -c "$VM_NAME" "$QCOW_FILE" + builder/refresh.sh vo.access.egi.eu "$(cat /var/tmp/egi/.refresh_token)" images + OS_TOKEN="$(yq -r '.clouds.images.auth.token' /etc/openstack/clouds.yaml)" + SHA="$(sha512sum -z "$QCOW_FILE" | cut -f1 -d" ")" + { + ls -lh "$QCOW_FILE" + openstack --os-cloud images --os-token "$OS_TOKEN" \ + object create egi_endorsed_vas \ + "$QCOW_FILE" + echo "SUCCESSFUL BUILD - $QCOW_FILE - $SHA" + } >>/var/log/image-build.log fi echo "BUILD ENDED" >>/var/log/image-build.log diff --git a/ubuntu/ubuntu-22.04.json b/ubuntu/ubuntu-22.04.json index a428dfb..898b57f 100644 --- a/ubuntu/ubuntu-22.04.json +++ b/ubuntu/ubuntu-22.04.json @@ -34,7 +34,7 @@ "qemuargs": [ [ "-cpu", "host" ] ], - "vm_name": "Ubuntu.22.04-2024.07.31" + "vm_name": "Ubuntu.22.04-2024.08.06" } ], "provisioners": [