Merge "update has docs" into beijing
[optf/has.git] / build-dockers.sh
1 #!/bin/bash
2 BUILD_ARGS="--no-cache"
3 ORG="onap"
4 VERSION="1.1.1"
5 STAGING="1.1.1-STAGING"
6 PROJECT="optf-has"
7 DOCKER_REPOSITORY="nexus3.onap.org:10003"
8 IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}"
9 TIMESTAMP=$(date +"%Y%m%dT%H%M%S")
10  
11 if [ $HTTP_PROXY ]; then
12 BUILD_ARGS+=" --build-arg HTTP_PROXY=${HTTP_PROXY}"
13 fi
14 if [ $HTTPS_PROXY ]; then
15     BUILD_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
16 fi
17  
18 function build_image(){
19      echo Building Image 
20      docker build -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest -t ${IMAGE_NAME}:${STAGING}  conductor/docker
21      echo ... Built
22 }
23
24 function push_image(){
25      echo Pushing image starts.
26      build_image             
27
28      docker push ${IMAGE_NAME}:${VERSION}
29      docker push ${IMAGE_NAME}:latest
30      docker push ${IMAGE_NAME}:STAGING
31
32      echo ... Pushed $1
33 }
34
35 push_image 
36