From 64b9123470196df69627164d7517d46f4bed8b4a Mon Sep 17 00:00:00 2001 From: Enol Fernandez Date: Mon, 5 Aug 2024 14:14:32 +0100 Subject: [PATCH] Do build --- builder/build-image.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/builder/build-image.sh b/builder/build-image.sh index f7be5ea..ebe7eaa 100755 --- a/builder/build-image.sh +++ b/builder/build-image.sh @@ -28,16 +28,16 @@ packer plugins install github.com/hashicorp/qemu 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)" -# 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 -#fi +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)" + 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 +fi echo "BUILD ENDED" >>/var/log/image-build.log