Modify database part in the deployment
[vfc/nfvo/driver/vnfm/svnfm.git] / nokia / vnfmdriver / vfcadaptorservice / docker / build_image.sh.bak
1 #!/bin/bash
2 #
3 # Copyright 2017, Nokia Corporation
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #     http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 #
18 # This file was auto-generated by gen-all-dockerfiles.sh; do not modify manually.
19 #
20 # nfvo-driver-vnfm-nokia/target/docker-entrypoint.sh
21 #
22 DIRNAME=`dirname $0`
23 DOCKER_BUILD_DIR=`cd $DIRNAME/; pwd`
24 echo "DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}"
25 cd ${DOCKER_BUILD_DIR}
26
27 BUILD_ARGS="--no-cache"
28 ORG="onap"
29 VERSION="1.0.0-SNAPSHOT"
30 PROJECT="vfc"
31 IMAGE="nfvo/svnfm/nokia"
32 DOCKER_REPOSITORY="nexus3.onap.org:10003"
33 IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}"
34
35 if [ $HTTP_PROXY ]; then
36     BUILD_ARGS+=" --build-arg HTTP_PROXY=${HTTP_PROXY}"
37 fi
38 if [ $HTTPS_PROXY ]; then
39     BUILD_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
40 fi
41
42 function build_image {
43     echo "Start build docker image: ${IMAGE_NAME}"
44     docker build ${BUILD_ARGS} -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest .
45 }
46
47 function push_image {
48     echo "Start push docker image: ${IMAGE_NAME}"
49     docker push ${IMAGE_NAME}:${VERSION}
50     docker push ${IMAGE_NAME}:latest
51 }
52
53 build_image
54 push_image