From: garciadeblas Date: Mon, 19 Mar 2018 16:38:04 +0000 (+0100) Subject: install_osm.sh updated to delete old imported lxd images X-Git-Tag: v3.0.3~1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F88%2F5888%2F1;p=osm%2Fdevops.git install_osm.sh updated to delete old imported lxd images Change-Id: Ie4f2e0992e85b9e9a7380ea3d18cf47e46cc886f Signed-off-by: garciadeblas --- diff --git a/installers/install_osm.sh b/installers/install_osm.sh index 947c6371..7175793f 100755 --- a/installers/install_osm.sh +++ b/installers/install_osm.sh @@ -54,6 +54,10 @@ function uninstall(){ lxc stop VCA && lxc delete VCA lxc stop SO-ub && lxc delete SO-ub fi + echo -e "\nDeleting imported lxd images if they exist" + lxc image show osm-ro &>/dev/null && lxc image delete osm-ro + lxc image show osm-vca &>/dev/null && lxc image delete osm-vca + lxc image show osm-soui &>/dev/null && lxc image delete osm-soui } #Configure NAT rules, based on the current IP addresses of containers @@ -384,11 +388,18 @@ function install_from_lxdimages(){ LXD_IMAGE_DIR="$(mktemp -d -q --tmpdir "osmimages.XXXXXX")" trap 'rm -rf "$LXD_IMAGE_DIR"' EXIT wget -O $LXD_IMAGE_DIR/osm-ro.tar.gz $LXD_REPOSITORY_BASE/$LXD_RELEASE/osm-ro.tar.gz + echo -e "\nDeleting previous lxd images if they exist" + lxc image show osm-ro &>/dev/null && lxc image delete osm-ro + lxc image show osm-vca &>/dev/null && lxc image delete osm-vca + lxc image show osm-soui &>/dev/null && lxc image delete osm-soui + echo -e "\nImporting osm-ro" lxc image import $LXD_IMAGE_DIR/osm-ro.tar.gz --alias osm-ro rm -f $LXD_IMAGE_DIR/osm-ro.tar.gz wget -O $LXD_IMAGE_DIR/osm-vca.tar.gz $LXD_REPOSITORY_BASE/$LXD_RELEASE/osm-vca.tar.gz + echo -e "\nImporting osm-vca" lxc image import $LXD_IMAGE_DIR/osm-vca.tar.gz --alias osm-vca rm -f $LXD_IMAGE_DIR/osm-vca.tar.gz + echo -e "\nImporting osm-soui" wget -O $LXD_IMAGE_DIR/osm-soui.tar.gz $LXD_REPOSITORY_BASE/$LXD_RELEASE/osm-soui.tar.gz lxc image import $LXD_IMAGE_DIR/osm-soui.tar.gz --alias osm-soui rm -f $LXD_IMAGE_DIR/osm-soui.tar.gz