blob: bd91f21cad9119df3023d4c7d472918a6d203ff7 [file] [log] [blame]
liboNet76cb1592019-04-12 02:41:04 +08001#!/bin/bash
2# Copyright (c) 2017-2018 VMware, Inc.
3#
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:
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
13DIRNAME=`dirname $0`
14DOCKER_BUILD_DIR=`cd $DIRNAME/; pwd`
15echo "DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}"
16cd ${DOCKER_BUILD_DIR}
17
18BUILD_ARGS="--no-cache"
19ORG="onap"
efiacord663a162022-11-28 09:18:35 +000020VERSION="1.9.1-SNAPSHOT"
21STAGING_VERSION="1.9.1-STAGING"
liboNet76cb1592019-04-12 02:41:04 +080022PROJECT="multicloud"
23IMAGE="framework-artifactbroker"
24DOCKER_REPOSITORY="nexus3.onap.org:10003"
25IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}"
26
27if [ $HTTP_PROXY ]; then
28 BUILD_ARGS+=" --build-arg HTTP_PROXY=${HTTP_PROXY}"
29fi
30if [ $HTTPS_PROXY ]; then
31 BUILD_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
32fi
33
34function build_image {
35 docker build ${BUILD_ARGS} -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest -t ${IMAGE_NAME}:${STAGING_VERSION} .
36}
37
38function push_image {
39 docker push ${IMAGE_NAME}:${VERSION}
40 docker push ${IMAGE_NAME}:${STAGING_VERSION}
41 docker push ${IMAGE_NAME}:latest
42}
43
44build_image
45push_image