From 6cd88df5afbb7226a67b7de518d83cde1cdb8eec Mon Sep 17 00:00:00 2001 From: "C.J. Collier" Date: Tue, 19 Jul 2016 15:00:27 -0700 Subject: Improvements to re-spin scripts * Skip tasks which have already been completed * correct bugs in variable definition order * Respin::latest_src_age being called with arguments to perl -e to ease interpolation * Writing environment changes to .bashrc instead of .bash_profile Change-Id: I95b07d4ccb510fb5cc0afdefc6b7521f9992463b Signed-off-by: C.J. Collier --- scripts/respin-jcloud-images.sh | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'scripts/respin-jcloud-images.sh') diff --git a/scripts/respin-jcloud-images.sh b/scripts/respin-jcloud-images.sh index 2af9e4c1b..f86c81644 100755 --- a/scripts/respin-jcloud-images.sh +++ b/scripts/respin-jcloud-images.sh @@ -13,6 +13,24 @@ CI_MGMT=$(realpath $(dirname $(realpath $0))/..) 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} + echo nova: $(which nova) export NETID=${NETID:-$(nova network-list | awk "/${CPPROJECT}/ {print \$2}")} @@ -25,19 +43,7 @@ do ARCH="${DVA[2]}" DTYPE=$(dist_type ${DIST}) - AGE_JSON=$(latest_src_age ${DIST} ${VERSION} ${ARCH}); - - # only fetch new base image if our latest one is more than two weeks old - if [ $(echo ${AGE_JSON} | jq .week) -ge "3" ] - then - # Acquire bootstrap images - download_${DTYPE}_image "${DIST}" "${VERSION}" "${ARCH}" - - # Push images to openstack via glance - create_${DTYPE}_image "${DIST}" "${VERSION}" "${ARCH}" - fi - # Respin images - cd ${CI_MGMT}/vagrant/basebuild + cd ${VAGRANT_DIR} respin_${DTYPE}_image "${DIST}" "${VERSION}" "${ARCH}" done -- cgit 1.2.3-korg