X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=scripts%2Frespin-jcloud-images.sh;h=f86c8164466db3d3592b0d85efb0ca1102bc1f94;hb=075ded3718f03d6ad3c3eb23685f06ed6cc8673b;hp=64a5c92f3d48eb8425947641315a187057793ee5;hpb=995d396e9310ded5827f5ee17c345b06234f68ca;p=ci-management.git diff --git a/scripts/respin-jcloud-images.sh b/scripts/respin-jcloud-images.sh index 64a5c92f3..f86c81644 100755 --- a/scripts/respin-jcloud-images.sh +++ b/scripts/respin-jcloud-images.sh @@ -1,25 +1,49 @@ #!/bin/bash - +# Copyright 2016 The Linux Foundation set -e +SUPPORTED_PLATFORMS=( + 'Ubuntu 14.04 amd64' + 'Ubuntu 16.04 amd64' + 'CentOS 7 x86_64' +) + CI_MGMT=$(realpath $(dirname $(realpath $0))/..) -# Copyright 2016 The Linux Foundation source ${CI_MGMT}/vagrant/lib/respin-functions.sh +source ${PVERC} + +VAGRANT_DIR=${CI_MGMT}/vagrant/basebuild + +# Fetch MVN package +MAVEN_MIRROR=apache.mirrors.tds.net +MAVEN_VERSION=3.3.9 +MAVEN_FILENAME=apache-maven-${MAVEN_VERSION}-bin.tar.gz +MAVEN_RELEASE=http://${MAVEN_MIRROR}/maven/maven-3/${MAVEN_VERSION}/binaries/${MAVEN_FILENAME} + +TRIES=10 + +wget -t ${TRIES} -q -O ${VAGRANT_DIR}/${MAVEN_FILENAME} ${MAVEN_RELEASE} + +# Fetch EPEL package +EPEL_RPM=epel-release-latest-7.noarch.rpm +EPEL_RELEASE=https://dl.fedoraproject.org/pub/epel/${EPEL_RPM} + +wget -t ${TRIES} -q -O ${VAGRANT_DIR}/${EPEL_RPM} ${EPEL_RELEASE} -source ${PVE_PATH}/bin/activate +echo nova: $(which nova) -# Acquire bootstrap images -#download_deb_image 'Ubuntu' '14.04' 'amd64' -#download_deb_image 'Ubuntu' '16.04' 'amd64' -#download_rh_image 'CentOS' '7' 'x86_64' +export NETID=${NETID:-$(nova network-list | awk "/${CPPROJECT}/ {print \$2}")} -# Push images to openstack via glance -#create_deb_image 'Ubuntu' '14.04' 'amd64' -#create_deb_image 'Ubuntu' '16.04' 'amd64' -#create_rh_image 'CentOS' '7' 'x86_64' +for PLATFORM in "${SUPPORTED_PLATFORMS[@]}" +do + read -ra DVA <<< "${PLATFORM}" + DIST="${DVA[0]}" + VERSION="${DVA[1]}" + ARCH="${DVA[2]}" + DTYPE=$(dist_type ${DIST}) -# Respin images -respin_deb_image 'Ubuntu' '14.04' 'amd64' -respin_deb_image 'Ubuntu' '16.04' 'amd64' -respin_rh_image 'CentOS' '7' 'x86_64' + # Respin images + cd ${VAGRANT_DIR} + respin_${DTYPE}_image "${DIST}" "${VERSION}" "${ARCH}" +done