summaryrefslogtreecommitdiffstats
path: root/ci/create_glance_image.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/create_glance_image.sh')
-rwxr-xr-xci/create_glance_image.sh37
1 files changed, 31 insertions, 6 deletions
diff --git a/ci/create_glance_image.sh b/ci/create_glance_image.sh
index 8811897..e99de8c 100755
--- a/ci/create_glance_image.sh
+++ b/ci/create_glance_image.sh
@@ -8,13 +8,38 @@
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-echo "Checking for Ubuntu 16.04 image in Glance"
-IMAGE=`openstack image list | grep "Ubuntu 16.04 x86_64"`
+ARCH="${ARCH:-$(uname -m)}"
+
+IMAGE_NAME="Ubuntu 16.04 ${ARCH}"
+
+echo "Checking for ${IMAGE_NAME} in Glance"
+
+IMAGE="$(openstack image list | grep "${IMAGE_NAME}")"
+PROPERTIES=""
if [ -z "$IMAGE" ]
then
- wget -q https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img
- openstack image create "Ubuntu 16.04 x86_64" --disk-format qcow2 --public \
- --container-format bare --file ubuntu-16.04-server-cloudimg-amd64-disk1.img
+
+ case "${ARCH}" in
+ aarch64)
+ FILE=ubuntu-16.04-server-cloudimg-arm64-uefi1.img
+ PROPERTIES="--property hw_firmware_type=uefi --property hw_video_model=vga"
+ ;;
+ armhf)
+ FILE=ubuntu-16.04-server-cloudimg-armhf-disk1.img
+ ;;
+ x86_64)
+ FILE=ubuntu-16.04-server-cloudimg-amd64-disk1.img
+ ;;
+ *)
+ echo "Unsupported architecture: ${ARCH}"
+ exit 1
+ ;;
+ esac
+
+ wget --continue -q "https://cloud-images.ubuntu.com/releases/16.04/release/${FILE}"
+ openstack image create "${IMAGE_NAME}" --disk-format qcow2 --public \
+ ${PROPERTIES} \
+ --container-format bare --file "${FILE}"
fi
-openstack image show "Ubuntu 16.04 x86_64"
+openstack image show "${IMAGE_NAME}"