blob: 73a8db67b23dc5f64ad0a37fcac133580d51a7f2 [file] [log] [blame]
Ethan Lynnc7633872017-08-28 16:45:26 +08001#!/bin/bash
Ethan Lynnb1940de2017-09-07 17:48:06 +08002DIRNAME=`dirname $0`
3DOCKER_BUILD_DIR=`cd $DIRNAME/; pwd`
4echo "DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}"
5cd ${DOCKER_BUILD_DIR}
Ethan Lynnc7633872017-08-28 16:45:26 +08006
Ethan Lynnb1940de2017-09-07 17:48:06 +08007BUILD_ARGS="--no-cache"
8ORG="onap"
9VERSION="1.0.0-SNAPSHOT"
10PROJECT="multicloud"
11IMAGE="framework"
12DOCKER_REPOSITORY="nexus3.onap.org:10003"
13IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}"
Ethan Lynnc7633872017-08-28 16:45:26 +080014
Ethan Lynnb1940de2017-09-07 17:48:06 +080015if [ $HTTP_PROXY ]; then
16 BUILD_ARGS+=" --build-arg HTTP_PROXY=${HTTP_PROXY}"
17fi
18if [ $HTTPS_PROXY ]; then
19 BUILD_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
20fi
21
22function build_image {
23 docker build ${BUILD_ARGS} -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest .
24}
25
26function push_image {
27 docker push ${IMAGE_NAME}:${VERSION}
28 docker push ${IMAGE_NAME}:latest
29}
30
31build_image
32push_image