summaryrefslogtreecommitdiffstats
path: root/docker/build_image.sh
blob: 508f0b419e700a17850acfa7f8c94abb97ff9a25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

MYSQL_ROOT_PASSWORD="root"
PROXY_ARGS=""
ORG="onap"
VERSION="1.0.0-SNAPSHOT"
PROJECT="vfc"
IMAGE="nslcm"
DOCKER_REPOSITORY="nexus3.onap.org:10003"

if [ $HTTP_PROXY ]; then
    PROXY_ARGS+="--build-arg HTTP_PROXY=${HTTP_PROXY}"
fi
if [ $HTTPS_PROXY ]; then
    PROXY_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
fi

function build_lcm {
    docker build ${PROXY_ARGS} --build-arg MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} -t ${ORG}/${PROJECT}/${IMAGE}:${VERSION} -t ${ORG}/${PROJECT}/${IMAGE}:latest .
}

function push_lcm {
    docker push ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}:${VERSION}
    docker push ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}:latest
}

build_lcm
push_lcm
docker image list