eb7db9d04aaa46108a5d632075584ad8e2b13ffd
[vfc/gvnfm/vnflcm.git] / lcm / docker / build_image.sh
1 #!/bin/bash
2
3 MYSQL_ROOT_PASSWORD="root"
4 PROXY_ARGS=""
5 ORG="onap"
6 VERSION="1.0.0-SNAPSHOT"
7 IMAGE="vfc-gvnfm-vnflcm"
8 DOCKER_REPOSITORY="nexus3.onap.org:10003"
9
10 if [ $HTTP_PROXY ]; then
11     PROXY_ARGS+="--build-arg HTTP_PROXY=${HTTP_PROXY}"
12 fi
13 if [ $HTTPS_PROXY ]; then
14     PROXY_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
15 fi
16
17 function build_vnflcm {
18     docker build ${PROXY_ARGS} --build-arg MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} -t ${ORG}/${IMAGE}:${VERSION} -t ${ORG}/${IMAGE}:latest .
19 }
20
21 function push_vnflcm {
22     docker push ${DOCKER_REPOSITORY}/${ORG}/${IMAGE}:${VERSION}
23     docker push ${DOCKER_REPOSITORY}/${ORG}/${IMAGE}:latest
24 }
25
26 build_vnflcm
27 push_vnflcm
28 docker image list