]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
scripts: Keep vagrant boxes up to date on static libvirt slaves
authorDavid Galloway <dgallowa@redhat.com>
Thu, 28 Sep 2017 16:50:39 +0000 (12:50 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Thu, 28 Sep 2017 17:19:37 +0000 (13:19 -0400)
Signed-off-by: David Galloway <dgallowa@redhat.com>
ceph-ansible-nightly/build/build
ceph-ansible-prs/build/build
ceph-ansible-scenario/build/build
ceph-docker-nightly/build/build
ceph-docker-prs/build/build
scripts/build_utils.sh

index 4cea7f09db971f59c1aa26bbd9a14db9af05741a..21e182d912360cba448ccfa3ec98dee5d916f5bd 100644 (file)
@@ -12,6 +12,7 @@ WORKDIR=$(mktemp -td tox.XXXXXXXXXX)
 delete_libvirt_vms
 clear_libvirt_networks
 restart_libvirt_services
+update_vagrant_boxes
 
 # the $SCENARIO var is injected by the job template. It maps
 # to an actual, defined, tox environment
index 11a41a1c92a9515e8ce759fd6f3dc3487ba9b299..2ef63acbb9fd9f9ac1906b330e5a193895a27f63 100644 (file)
@@ -12,6 +12,7 @@ WORKDIR=$(mktemp -td tox.XXXXXXXXXX)
 delete_libvirt_vms
 clear_libvirt_networks
 restart_libvirt_services
+update_vagrant_boxes
 
 # This was initially in teardown but sometimes, it happens that the Jenkins Slave process
 # crashes before teardown is executed, it means we keep leftofver from previous build.
index 665c435568a5b0f276a5cab4ab36e95bb0a6d17e..678004d4bcb32afc6273832230cfa2388c15c8be 100644 (file)
@@ -12,6 +12,7 @@ WORKDIR=$(mktemp -td tox.XXXXXXXXXX)
 delete_libvirt_vms
 clear_libvirt_networks
 restart_libvirt_services
+update_vagrant_boxes
 
 # the $SCENARIO var is injected by the job configuration. It maps
 # to an actual, defined, tox environment
index 8b9adb4bc8be60a2fe5c5f267a5b189c548a5ba1..68a64c5fcd7c1fc10caf30314755a503948e79f4 100644 (file)
@@ -18,6 +18,7 @@ newgrp docker
 delete_libvirt_vms
 clear_libvirt_networks
 restart_libvirt_services
+update_vagrant_boxes
 
 # adding groups on the fly doesn't guarantee their availability
 # so we must use `sg` to execute the tests as part of the docker group to avoid
index 6eabf8e4e4efabb5799790302d19b840eb092011..a2995e8762b7aebf66357aa2e6ae45c8735ee483 100644 (file)
@@ -18,6 +18,7 @@ newgrp docker
 delete_libvirt_vms
 clear_libvirt_networks
 restart_libvirt_services
+update_vagrant_boxes
 
 # adding groups on the fly doesn't guarantee their availability
 # so we must use `sg` to execute the tests as part of the docker group to avoid
index 611c6385030c7daf8cbd5f05270e69e089f2c8f9..1e143ff2e391e053fd3fdf8e778e2c572836877d 100644 (file)
@@ -439,3 +439,15 @@ restart_libvirt_services() {
     sudo service libvirt-bin restart
     sudo service libvirt-guests restart
 }
+
+# Function to update vagrant boxes on static libvirt slaves used for ceph-ansible and ceph-docker testing
+update_vagrant_boxes() {
+    outdated_boxes=`vagrant box outdated --global | grep 'is outdated' | awk '{ print $2 }' | | tr -d "'"`
+    if [ -n "$outdated_boxes" ]; then
+        for box in $outdated_boxes; do
+            vagrant box update --box $box
+        done
+        # Clean up old images
+        vagrant box prune
+    fi
+}