diff --git a/roles/build-sahara-images-dib/defaults/main.yaml b/roles/build-sahara-images-dib/defaults/main.yaml index d54f7d5d..b2defb97 100644 --- a/roles/build-sahara-images-dib/defaults/main.yaml +++ b/roles/build-sahara-images-dib/defaults/main.yaml @@ -2,3 +2,5 @@ sahara_image_elements_src_dir: "{{ zuul.projects['git.openstack.org/openstack/sahara-image-elements'].src_dir }}" sahara_build_directory: /var/tmp/sahara-image-build sahara_plugin: vanilla +sahara_plugin_version: '' +sahara_plugin_distro: '' diff --git a/roles/build-sahara-images-dib/tasks/main.yaml b/roles/build-sahara-images-dib/tasks/main.yaml index 8733bbe8..e2a354fe 100644 --- a/roles/build-sahara-images-dib/tasks/main.yaml +++ b/roles/build-sahara-images-dib/tasks/main.yaml @@ -1,4 +1,4 @@ - name: Build all the images for the selected plugin - command: ./tools/gate/build-images "{{ sahara_plugin }}" + command: ./tools/gate/build-images "{{ sahara_plugin }}" "{{ sahara_plugin_version }}" "{{ sahara_plugin_distro }}" args: chdir: "{{ sahara_image_elements_src_dir }}" diff --git a/tools/gate/build-images b/tools/gate/build-images index 3cac6a62..7b0af128 100755 --- a/tools/gate/build-images +++ b/tools/gate/build-images @@ -1,7 +1,35 @@ #!/bin/bash -xe PLUGIN=$1 +PLUGIN_VERSION=${2:-''} +PLUGIN_DISTRO=${3:-''} + export DIB_MIN_TMPFS=10 + +# build a specific version if requested +if [ -n "${PLUGIN}" ] && [ -n "${PLUGIN_VERSION}" ] && [ -n "${PLUGIN_DISTRO}" ]; then + case ${PLUGIN} in + vanilla|cloudera|ambari) + VERSION_FLAG="-v ${PLUGIN_VERSION}" + ;; + mapr) + VERSION_FLAG="-r ${PLUGIN_VERSION}" + ;; + spark) + VERSION_FLAG="-s ${PLUGIN_VERSION}" + ;; + storm) + VERSION_FLAG="-t ${PLUGIN_VERSION}" + ;; + *) + VERSION_FLAG="" + ;; + esac + tox -e venv -- sahara-image-create -x -u -p ${PLUGIN} -i ${PLUGIN_DISTRO} ${VERSION_FLAG} + exit +fi + +# build (almost) all versions for a specified plugin case "$PLUGIN" in "vanilla") # temporary don't test building fedora image