manila-image-elements/tools/gate/build-images
Goutham Pacha Ravi a833b762d7 Modify job to build images
We currently only build the generic driver
image with the job "manila-image-elements-buildimage-generic".
Since we'd like to use a cephfs based client image,
we can reuse the job to produce two images instead
of one. The new job "manila-image-elements-buildimages"
produces two images: "manila-service-image-cephfs-{tag}.qcow2"
and "manila-service-image-{tag}.qcow2"; where the
tag corresponds to the version of this project.

The job also creates a soft link of the tagged images
with a "-master" suffix instead of the tag - this
is useful for CI jobs that don't need to worry
about changing/using the latest tag.

Change-Id: I60c6b38b5d5de7649c0d760519a79288fafca1e3
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-05-21 15:44:12 -07:00

23 lines
743 B
Bash

#!/bin/bash -xe
# Argument is expected to be type of image. Use 'generic' to build an image
# with NFS and CIFS for use with Manila's Generic driver. Or specify a
# protocol (ex: cephfs) to build an image with protocol specific packages,
# or use "docker" to build a container image for use with the Container driver.
IMAGE=$1
if [[ "$IMAGE" == "generic"* ]]; then
tox -v -e buildimage
image_name="manila-service-image.qcow2"
elif [[ "$IMAGE" == @(docker|container)* ]]; then
tox -v -e buildimage-docker
image_name="manila-docker-container.tar.gz"
else
export MANILA_IMG_NAME="manila-service-image-$IMAGE"
tox -v -e buildimage -- -s $IMAGE
image_name="$MANILA_IMG_NAME.qcow2"
fi
echo $image_name > ./IMAGE_NAME