Update k8splugin snapshot image
[multicloud/k8s.git] / deployments / build.sh
index 90da6f9..1b00b07 100755 (executable)
@@ -12,9 +12,8 @@ set -o nounset
 set -o pipefail
 
 k8s_path="$(git rev-parse --show-toplevel)"
-export GOPATH=$k8s_path
 
-VERSION="0.1.0"
+VERSION="0.8.1-SNAPSHOT"
 export IMAGE_NAME="nexus3.onap.org:10003/onap/multicloud/k8s"
 
 function _compile_src {
@@ -35,7 +34,9 @@ function _cleanup {
     echo "Cleaning previous execution"
     docker-compose kill
     image=$(grep "image.*k8plugin" docker-compose.yml)
-    docker images ${image#*:} -q | xargs docker rmi -f
+    if [[ -n ${image} ]]; then
+        docker images ${image#*:} -q | xargs docker rmi -f
+    fi
     docker ps -a --filter "status=exited" -q | xargs docker rm
 }
 
@@ -48,6 +49,7 @@ function _push_image {
     local tag_name=${IMAGE_NAME}:${1:-latest}
 
     echo "Start push {$tag_name}"
+    docker push ${IMAGE_NAME}:latest
     docker tag ${IMAGE_NAME}:latest ${tag_name}
     docker push ${tag_name}
 }