From 33f598fd9e4e9715ce30f8aaeff4f87f2078aa5c Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Thu, 16 Mar 2017 14:53:35 +0800 Subject: download and pack cirros image into opnfv.bin In daisy-build job, download and pack cirros 0.3.5 image into daisy image file. Then post-deploy script can use it as a glance image. It will locate in /var/lib/daisy/images/ on daisy server. Change-Id: I1bf67c32bd245b43dd50974076daaca04721bc11 Signed-off-by: Alex Yang --- code/install_interface_patch.sh | 2 ++ code/makefile_patch.sh | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/code/install_interface_patch.sh b/code/install_interface_patch.sh index d1806e00..1a0fa73f 100755 --- a/code/install_interface_patch.sh +++ b/code/install_interface_patch.sh @@ -22,3 +22,5 @@ if [ ! -e "$imagedir/registry-server.tar" ];then fi cp CentOS*.iso /var/lib/daisy/kolla +mkdir -p /var/lib/daisy/images/ +cp cirros*.img /var/lib/daisy/images/ diff --git a/code/makefile_patch.sh b/code/makefile_patch.sh index eeacb169..8d83f4e5 100755 --- a/code/makefile_patch.sh +++ b/code/makefile_patch.sh @@ -8,14 +8,23 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## + TOOLS_PATH=$1 CACHE_PATH=/home/cache + imagebranch="newton" imageversion="latest" imageserver="http://120.24.17.215" imagename="kolla-image-$imagebranch-$imageversion.tgz" + isoname="CentOS-7-x86_64-Minimal-1611.iso" isourl="http://buildlogs.centos.org/rolling/7/isos/x86_64/${isoname}" + +cirros_server="http://download.cirros-cloud.net" +cirros_ver="0.3.5" +cirros_filename="cirros-${cirros_ver}-x86_64-disk.img" +cirros_url=${cirros_server}/${cirros_ver}/${cirros_filename} + if [ ! -d $CACHE_PATH ]; then mkdir -p $CACHE_PATH ; fi if [ ! -f $CACHE_PATH/${isoname} ]; then wget -P $CACHE_PATH $isourl @@ -26,8 +35,14 @@ fi if [ ! -f $CACHE_PATH/registry-server.tar ]; then wget -P $CACHE_PATH "http://daisycloud.org/static/files/registry-server.tar" fi +if [ ! -f $CACHE_PATH/${cirros_filename} ]; then + wget -P $CACHE_PATH ${cirros_url} +fi + cp $CACHE_PATH/${isoname} $TOOLS_PATH/setup/bin_temp/ cp $CACHE_PATH/$imagename $TOOLS_PATH/setup/bin_temp/ cp $CACHE_PATH/registry-server.tar $TOOLS_PATH/setup/bin_temp/ +cp $CACHE_PATH/${cirros_filename} $TOOLS_PATH/setup/bin_temp/ + cp $TOOLS_PATH/setup/install_interface_patch.sh $TOOLS_PATH/setup/bin_temp/ chmod +x $TOOLS_PATH/setup/bin_temp/install_interface_patch.sh -- cgit 1.2.3-korg