summaryrefslogtreecommitdiffstats
path: root/nfvbenchvm/dib/build-image.sh
diff options
context:
space:
mode:
authorfmenguy <francoisregis.menguy@orange.com>2021-05-17 13:11:35 +0200
committerfmenguy <francoisregis.menguy@orange.com>2021-05-17 13:28:42 +0200
commitd4741875ea90764d89ea8f7193c7210c667d3424 (patch)
tree6490638af9117f4532f9f9036a1f3f1c83cead76 /nfvbenchvm/dib/build-image.sh
parent424d660b5355205afeb736163d3e6cf140e9b9f1 (diff)
Revert cleanup and allow force push image to GS (tmp)
Change-Id: Ic742d0f538b62a101d3c3752fd2008163bb3bbe0 Signed-off-by: fmenguy <francoisregis.menguy@orange.com>
Diffstat (limited to 'nfvbenchvm/dib/build-image.sh')
-rwxr-xr-xnfvbenchvm/dib/build-image.sh45
1 files changed, 11 insertions, 34 deletions
diff --git a/nfvbenchvm/dib/build-image.sh b/nfvbenchvm/dib/build-image.sh
index c595f6b..f27ce77 100755
--- a/nfvbenchvm/dib/build-image.sh
+++ b/nfvbenchvm/dib/build-image.sh
@@ -53,39 +53,20 @@ __version__=0.13
loopvm_image_name=nfvbenchvm_centos-$__version__
generator_image_name=nfvbenchvm_centos-generator-$__version__
-
-
-function cleanup_image {
- # if image exists skip building
- echo "Checking if image exists in google storage..."
- if command -v gsutil >/dev/null; then
- if gsutil -q stat gs://$gs_url/$1.qcow2; then
- gsutil rm http://$gs_url/$1.qcow2
- echo "Image is deleted"
- exit 0
- fi
- echo "Image does not exist in google storage, starting build..."
- echo
- else
- echo "Cannot check image availability in OPNFV artifact repository (gsutil not available)"
- fi
-}
-
-
function build_image {
# if image exists skip building
echo "Checking if image exists in google storage..."
- if command -v gsutil >/dev/null; then
- if gsutil -q stat gs://$gs_url/$1.qcow2; then
- echo "Image already exists at http://$gs_url/$1.qcow2"
- echo "Build is skipped"
- exit 0
- fi
- echo "Image does not exist in google storage, starting build..."
- echo
- else
- echo "Cannot check image availability in OPNFV artifact repository (gsutil not available)"
- fi
+ # if command -v gsutil >/dev/null; then
+ # if gsutil -q stat gs://$gs_url/$1.qcow2; then
+ # echo "Image already exists at http://$gs_url/$1.qcow2"
+ # echo "Build is skipped"
+ # exit 0
+ # fi
+ # echo "Image does not exist in google storage, starting build..."
+ # echo
+ # else
+ # echo "Cannot check image availability in OPNFV artifact repository (gsutil not available)"
+ # fi
# check if image is already built locally
if [ -f $1.qcow2 ]; then
@@ -152,12 +133,8 @@ function build_image {
if [ ! $generator_only -eq 1 ] && [ ! $loopvm_only -eq 1 ]; then
- echo "cleanup old loop VM image (wrong content)"
- cleanup_image $loopvm_image_name
echo "Build loop VM image"
build_image $loopvm_image_name
- echo "cleanup old generator VM image (wrong content)"
- cleanup_image $generator_image_name
echo "Build generator image"
build_image $generator_image_name
else