summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKerim Gokarslan <kgokarsl@cisco.com>2017-08-24 15:20:19 -0700
committerKerim Gokarslan <kgokarsl@cisco.com>2017-08-25 13:54:19 -0700
commit5de4ba44c806b7fc32f65e7e37be3a36f19794d9 (patch)
treea5dd44b0f267bc84964c7a185f483d8d649c98c1
parent42837a4bfe8732986551c9518bb12d0f28ebb30e (diff)
NFVBENCH-9 Create VM image and upload to OPNFV artfact repo
Change-Id: Iffad4cccacccbb3df240d1b004c27ae209cec701 Signed-off-by: Kerim Gokarslan <kgokarsl@cisco.com>
-rwxr-xr-xnfvbenchvm/dib/build-image.sh16
-rw-r--r--requirements.txt2
2 files changed, 16 insertions, 2 deletions
diff --git a/nfvbenchvm/dib/build-image.sh b/nfvbenchvm/dib/build-image.sh
index 034c4dd..3ff4696 100755
--- a/nfvbenchvm/dib/build-image.sh
+++ b/nfvbenchvm/dib/build-image.sh
@@ -5,10 +5,21 @@
# The following packages must be installed prior to using this script:
# sudo apt-get -y install python-virtualenv qemu-utils kpartx
+set -e
+
+# Artifact URL
+gs_url=artifacts.opnfv.org/nfvbench/images
+
# image version number
__version__=0.3
image_name=nfvbenchvm_centos-$__version__
+# if image exists skip building
+if gsutil -q stat gs://$gs_url/$image_name.qcow2; then
+ echo "Image already exists at http://$gs_url/$image_name.qcow2"
+ exit 0
+fi
+
# install diskimage-builder
if [ -d dib-venv ]; then
. dib-venv/bin/activate
@@ -37,5 +48,8 @@ export DIB_USE_ELREPO_KERNEL=True
echo "Building $image_name.qcow2..."
time disk-image-create -o $image_name centos7 nfvbenchvm
-
ls -l $image_name.qcow2
+
+echo "Uploading $image_name.qcow2..."
+gsutil cp $image_name.qcow2 gs://$gs_url/$image_name.qcow2
+echo "You can access to image at http://$gs_url/$image_name.qcow2"
diff --git a/requirements.txt b/requirements.txt
index 5cc6989..90b491d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -24,4 +24,4 @@ flask_socketio>=2.8.3
backports.ssl-match-hostname==3.5.0.1 # via websocket-client
socketIO-client==0.7.2
websocket-client==0.40.0 # via socketio-client
-fluent-logger>=0.5.2 \ No newline at end of file
+fluent-logger>=0.5.3