2 # Copyright (c) 2018 Amdocs
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 DOCKER_BUILD_DIR=`cd $DIRNAME/../; pwd`
18 echo "DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}"
19 cd ${DOCKER_BUILD_DIR}
21 BUILD_ARGS="--no-cache"
23 VERSION="1.2.2-SNAPSHOT"
24 STAGING="1.2.2-STAGING"
27 DOCKER_REPOSITORY="nexus3.onap.org:10003"
28 IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}"
30 if [ $HTTP_PROXY ]; then
31 BUILD_ARGS+=" --build-arg HTTP_PROXY=${HTTP_PROXY}"
33 if [ $HTTPS_PROXY ]; then
34 BUILD_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
37 function build_image {
38 echo "Start build docker image: ${IMAGE_NAME}"
39 docker build ${BUILD_ARGS} -f docker/Dockerfile -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest -t ${IMAGE_NAME}:${STAGING} .
43 echo "Start push docker image: ${IMAGE_NAME}"
44 docker push ${IMAGE_NAME}:${VERSION}
45 docker push ${IMAGE_NAME}:latest
46 docker push ${IMAGE_NAME}:${STAGING}