Add Ubuntu 18.04 support

Use squashfs for more recent Ubuntu releases

Change-Id: I80df28be6e2a5e03ae1450e84fc05715f21a7750
Closes-bug: 1766850
This commit is contained in:
Stanislav Makar 2018-05-15 10:42:31 +00:00 committed by Ian Wienand
parent a8df61edbb
commit 2e6a19a018
9 changed files with 26 additions and 6 deletions

View File

@ -23,6 +23,7 @@ release_numbers[wily]=15.10
release_numbers[xenial]=16.04
release_numbers[yakkety]=16.10
release_numbers[zesty]=17.04
release_numbers[bionic]=18.04
numeric_release=${release_numbers[$DIB_RELEASE]}
DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://cdimage.ubuntu.com/ubuntu-core/releases/$numeric_release/release}

View File

@ -14,7 +14,11 @@ shopt -s extglob
DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://cloud-images.ubuntu.com}
DIB_RELEASE=${DIB_RELEASE:-trusty}
BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$DIB_RELEASE-server-cloudimg-$ARCH-root.tar.gz}
if [ $DIB_RELEASE != "trusty" ] && [ $DIB_RELEASE != "xenial" ]; then
BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$DIB_RELEASE-server-cloudimg-$ARCH.squashfs}
else
BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$DIB_RELEASE-server-cloudimg-$ARCH-root.tar.gz}
fi
SHA256SUMS=${SHA256SUMS:-https://${DIB_CLOUD_IMAGES##http?(s)://}/$DIB_RELEASE/current/SHA256SUMS}
CACHED_FILE=$DIB_IMAGE_CACHE/$BASE_IMAGE_FILE
CACHED_FILE_LOCK=$DIB_LOCKFILES/$BASE_IMAGE_FILE.lock
@ -47,7 +51,11 @@ function get_ubuntu_tarball() {
fi
# Extract the base image (use --numeric-owner to avoid UID/GID mismatch between
# image tarball and host OS e.g. when building Ubuntu image on an openSUSE host)
sudo tar -C $TARGET_ROOT --numeric-owner -xzf $DIB_IMAGE_CACHE/$BASE_IMAGE_FILE
if [ $DIB_RELEASE != "trusty" ] && [ $DIB_RELEASE != "xenial" ]; then
sudo unsquashfs -f -d $TARGET_ROOT $DIB_IMAGE_CACHE/$BASE_IMAGE_FILE
else
sudo tar -C $TARGET_ROOT --numeric-owner -xzf $DIB_IMAGE_CACHE/$BASE_IMAGE_FILE
fi
}
(

View File

@ -0,0 +1,4 @@
Verify we can build a ubuntu image.
Note this test includes the vm element to test the bootloader install,
and specifies to output a .qcow2

View File

@ -0,0 +1,4 @@
block-device-mbr
openstack-ci-mirrors
vm

View File

@ -67,8 +67,8 @@
opensuse/build-succeeds \
opensuse/opensuse423-build-succeeds \
fedora/build-succeeds \
ubuntu/trusty-build-succeeds \
ubuntu/xenial-build-succeeds
ubuntu/xenial-build-succeeds \
ubuntu/bionic-build-succeeds
set +u
deactivate

View File

@ -67,8 +67,8 @@
opensuse/build-succeeds \
opensuse/opensuse423-build-succeeds \
fedora/build-succeeds \
ubuntu/trusty-build-succeeds \
ubuntu/xenial-build-succeeds
ubuntu/xenial-build-succeeds \
ubuntu/bionic-build-succeeds
set +u
deactivate

View File

@ -44,6 +44,7 @@ DEFAULT_SKIP_TESTS=(
fedora/build-succeeds
ubuntu/trusty-build-succeeds
ubuntu/xenial-build-succeeds
ubuntu/bionic-build-succeeds
# No longer reasonable to test upstream (lacks a mirror in infra)
# Note this is centos6 and should probably be removed