2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2018 Intel Corporation
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
14 k8s_path="$(git rev-parse --show-toplevel)"
16 VERSION="0.6.0-SNAPSHOT"
17 export IMAGE_NAME="nexus3.onap.org:10003/onap/multicloud/k8s"
19 function _compile_src {
20 echo "Compiling source code"
21 pushd $k8s_path/src/k8splugin/
27 echo "Moving binaries"
29 mv $k8s_path/src/k8splugin/k8plugin .
30 mv $k8s_path/src/k8splugin/plugins/*.so .
34 echo "Cleaning previous execution"
36 image=$(grep "image.*k8plugin" docker-compose.yml)
37 if [[ -n ${image} ]]; then
38 docker images ${image#*:} -q | xargs docker rmi -f
40 docker ps -a --filter "status=exited" -q | xargs docker rm
43 function _build_docker {
44 echo "Building docker image"
45 docker-compose build --no-cache
48 function _push_image {
49 local tag_name=${IMAGE_NAME}:${1:-latest}
51 echo "Start push {$tag_name}"
52 docker push ${IMAGE_NAME}:latest
53 docker tag ${IMAGE_NAME}:latest ${tag_name}
54 docker push ${tag_name}
57 if [[ -n "${JENKINS_HOME+x}" ]]; then
64 source /etc/environment