diff options
author | Mark Beierl <mark.beierl@dell.com> | 2017-09-14 18:55:27 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-09-14 18:55:27 +0000 |
commit | 11b25082420e359dfaf2e36eacd533d1f5b49aa9 (patch) | |
tree | 6d437fb21a6c186a6753a0acbda2c7878af83dba /ci/create_glance_image.sh | |
parent | e447ee55b2a57979f4a8fb002f1f80d6fae0cbe1 (diff) | |
parent | f92f97f53e3ee43c5d3b75673122ec9f94db196e (diff) |
Merge "Add Multi Arch to Docker"
Diffstat (limited to 'ci/create_glance_image.sh')
-rwxr-xr-x | ci/create_glance_image.sh | 37 |
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}" |