diff options
author | C.J. Collier <cjcollier@linuxfoundation.org> | 2016-07-19 15:00:27 -0700 |
---|---|---|
committer | C.J. Collier <cjcollier@linuxfoundation.org> | 2016-07-20 16:37:20 -0700 |
commit | 6cd88df5afbb7226a67b7de518d83cde1cdb8eec (patch) | |
tree | 11deabb9c6b92acd595dc84eac23fac08f6d1132 /vagrant/lib | |
parent | a96e385f192653e3f681a7ce183f7f76c7672d0f (diff) |
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 <cjcollier@linuxfoundation.org>
Diffstat (limited to 'vagrant/lib')
-rw-r--r-- | vagrant/lib/Respin.pm | 2 | ||||
-rw-r--r-- | vagrant/lib/respin-functions.sh | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/vagrant/lib/Respin.pm b/vagrant/lib/Respin.pm index e72c601a1..2db8181b5 100644 --- a/vagrant/lib/Respin.pm +++ b/vagrant/lib/Respin.pm @@ -20,6 +20,8 @@ my $dur_fmt = DateTime::Format::Duration->new( sub latest_src_age { my ( $now, $src ) = @_; + print STDERR "Computing duration between [$src] and [$now]\n"; + my ( %now, %src ); @now{qw(year month day hour minute second)} = ( $now =~ $iso8601_rx ); @src{qw(year month day hour minute second)} = ( $src =~ $iso8601_rx ); diff --git a/vagrant/lib/respin-functions.sh b/vagrant/lib/respin-functions.sh index 7aa742c32..0c92f8ee1 100644 --- a/vagrant/lib/respin-functions.sh +++ b/vagrant/lib/respin-functions.sh @@ -6,6 +6,7 @@ source ${CI_MGMT}/vagrant/lib/vagrant-functions.sh source ${PVERC} + pip install -q --upgrade pip setuptools python-{cinder,glance,keystone,neutron,nova,openstack}client # @@ -17,7 +18,7 @@ function latest_src_age () SRC_TS=$(latest_src_timestamp "$@") NOW_TS=$(new_timestamp) - perl -I${CI_MGMT}/vagrant/lib -MRespin -e 'Respin::latest_src_age( "${NOW_TS}", "${SRC_TS}" )' + perl -I${CI_MGMT}/vagrant/lib -MRespin -e 'Respin::latest_src_age( @ARGV )' "${NOW_TS}" "${SRC_TS}" return 0 } @@ -244,7 +245,7 @@ function respin_deb_image () DST_TIMESTAMP=$(new_dst_timestamp) setup_deb "$@" export IMAGE="${IMG_NAME}" - echo "--> creating instance of image '${IMAGE}' as server name '${SERVER_NAME}'" + echo "--> creating instance of image '${IMG_NAME}' as server name '${SERVER_NAME}'" vagrant up --provider=openstack if [ "Ubuntu" == "${DIST}" ] then @@ -267,7 +268,7 @@ function respin_rh_image () SRC_TIMESTAMP=$(latest_src_timestamp) DST_TIMESTAMP=$(new_dst_timestamp) setup_rh "$@" - IMAGE="${IMG_NAME}" + export IMAGE="${IMG_NAME}" echo "--> creating instance of image '${IMG_NAME}' as server name '${SERVER_NAME}'" vagrant up --provider=openstack DST_IMAGE="${DIST} ${VERSION} - basebuild - ${DST_TIMESTAMP}" |