Fixing docker build scipt
[aaf/authz.git] / auth / docker / drun.sh
1 #!/bin/bash drun.sh
2 ORG=onap
3 PROJECT=aaf
4 DOCKER_REPOSITORY=nexus3.onap.org:10003
5 VERSION=2.1.0-SNAPSHOT
6 ./d.props
7
8
9 if [ "$1" == "" ]; then
10   AAF_COMPONENTS=`ls -r ../aaf_${VERSION}/bin | grep -v '\.'`
11 else
12   AAF_COMPONENTS=$1
13 fi
14   
15 for AAF_COMPONENT in ${AAF_COMPONENTS}; do 
16         case "$AAF_COMPONENT" in
17                 "service") 
18                         PORTMAP="8100:8100"
19                         LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" 
20                         ;;
21                 "locate") 
22                         PORTMAP="8095:8095"
23                         LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" 
24                         ;;
25                 "oauth") 
26                         PORTMAP="8140:8140"
27                         LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" 
28                         ;;
29                 "gui") 
30                         PORTMAP="8200:8200"
31                         ;;
32                 "cm") 
33                         PORTMAP="8150:8150"
34                         LINKS="--link aaf_cass:cassandra --add-host=$CASS_HOST" 
35                         ;;
36                 "hello") 
37                         PORTMAP="8130:8130"
38                         ;;
39                 "fs") 
40                         PORTMAP="80:8096"
41                         ;;
42         esac
43         
44         echo Starting aaf_$AAF_COMPONENT...
45
46         docker run  \
47           -d \
48           --name aaf_$AAF_COMPONENT \
49           --hostname="${AAF_COMPONENT}.aaf.osaaf.org" \
50           --add-host="$HOSTNAME:$HOST_IP" \
51           --add-host="aaf.osaaf.org:$HOST_IP" \
52           ${LINKS} \
53           --publish $PORTMAP \
54           --mount type=bind,source=$CONF_ROOT_DIR,target=/opt/app/osaaf \
55           ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
56 done