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