diff options
author | Instrumental <jonathan.gathman@att.com> | 2019-01-22 10:27:32 -0600 |
---|---|---|
committer | Instrumental <jonathan.gathman@att.com> | 2019-01-22 10:32:14 -0600 |
commit | 12414fe43077e12d7ef711951b1633ad31d73573 (patch) | |
tree | 475166cee68c104b2f36625ef864a912aab50fa4 /auth/docker | |
parent | a5bcce655e339151445fbce2c129687e3bc8610a (diff) |
Public and Private Locate entries
Issue-ID: AAF-723
Change-Id: I9dcd2e732ce64b39aaa57a6e9404f275f7ad540c
Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/docker')
-rw-r--r-- | auth/docker/.gitignore | 2 | ||||
-rw-r--r-- | auth/docker/Dockerfile.base | 26 | ||||
-rw-r--r-- | auth/docker/Dockerfile.client | 7 | ||||
-rw-r--r-- | auth/docker/Dockerfile.config | 9 | ||||
-rw-r--r-- | auth/docker/Dockerfile.core | 4 | ||||
-rw-r--r-- | auth/docker/Dockerfile.ms | 5 | ||||
-rw-r--r-- | auth/docker/aaf.sh | 20 | ||||
-rw-r--r-- | auth/docker/agent.sh | 14 | ||||
-rw-r--r-- | auth/docker/components | 4 | ||||
-rw-r--r-- | auth/docker/d.props.init | 12 | ||||
-rw-r--r-- | auth/docker/dbash.sh | 2 | ||||
-rwxr-xr-x | auth/docker/dbuild.sh | 41 | ||||
-rw-r--r-- | auth/docker/drun.sh | 112 | ||||
-rw-r--r-- | auth/docker/dstart.sh | 2 | ||||
-rw-r--r-- | auth/docker/dstop.sh | 2 |
15 files changed, 144 insertions, 118 deletions
diff --git a/auth/docker/.gitignore b/auth/docker/.gitignore index 9e4bcf51..1c98ea37 100644 --- a/auth/docker/.gitignore +++ b/auth/docker/.gitignore @@ -6,3 +6,5 @@ /policy* /*.yaml /*.orig +/.curl_auth +/test.sh diff --git a/auth/docker/Dockerfile.base b/auth/docker/Dockerfile.base new file mode 100644 index 00000000..623d18d4 --- /dev/null +++ b/auth/docker/Dockerfile.base @@ -0,0 +1,26 @@ +######### +# ============LICENSE_START==================================================== +# org.onap.aaf +# =========================================================================== +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# =========================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END==================================================== +# +FROM nexus3.onap.org:10001/openjdk:8-jre-alpine +MAINTAINER AAF Team, AT&T 2018 + +LABEL description="aaf_base" +RUN apk add --no-cache bash +RUN apk add --no-cache openssl + diff --git a/auth/docker/Dockerfile.client b/auth/docker/Dockerfile.client index dab925b0..c2e1d787 100644 --- a/auth/docker/Dockerfile.client +++ b/auth/docker/Dockerfile.client @@ -17,7 +17,8 @@ # limitations under the License. # ============LICENSE_END==================================================== # -FROM nexus3.onap.org:10001/onap/aaf/aaf-base-xenial:latest +FROM ${DOCKER_REPOSITORY}/onap/aaf/aaf_base:${AAF_VERSION} +#FROM nexus3.onap.org:10001/onap/aaf/aaf-base-xenial:latest MAINTAINER AAF Team, AT&T 2018 ENV VERSION=${AAF_VERSION} @@ -30,6 +31,4 @@ COPY bin/aaf-auth-cmd-${AAF_VERSION}-full.jar /opt/app/aaf_config/bin/ COPY bin/aaf-cadi-servlet-sample-*-sample.jar /opt/app/aaf_config/bin/ COPY cert/*trust*.b64 /opt/app/aaf_config/cert/ -ENTRYPOINT ["/bin/bash","/opt/app/aaf_config/bin/agent.sh"] -CMD [] - +CMD ["/bin/bash","-c","/opt/app/aaf_config/bin/agent.sh"] diff --git a/auth/docker/Dockerfile.config b/auth/docker/Dockerfile.config index 44109d65..d1b6b237 100644 --- a/auth/docker/Dockerfile.config +++ b/auth/docker/Dockerfile.config @@ -17,7 +17,8 @@ # limitations under the License. # ============LICENSE_END==================================================== # -FROM nexus3.onap.org:10001/onap/aaf/aaf-base-xenial:latest +FROM ${DOCKER_REPOSITORY}/onap/aaf/aaf_base:${AAF_VERSION} +#FROM nexus3.onap.org:10001/onap/aaf/aaf-base-xenial:latest MAINTAINER AAF Team, AT&T 2018 ENV VERSION=${AAF_VERSION} @@ -34,7 +35,7 @@ COPY logs /opt/app/aaf_config/logs COPY bin/service.sh /opt/app/aaf_config/bin/agent.sh COPY bin/pod_wait.sh /opt/app/aaf_config/bin/ COPY bin/aaf-auth-cmd-${AAF_VERSION}-full.jar /opt/app/aaf_config/bin/ - -ENTRYPOINT ["/bin/bash","/opt/app/aaf_config/bin/agent.sh"] + +CMD ["/bin/bash","/opt/app/aaf_config/bin/agent.sh"] +#CMD ["/bin/bash","/opt/app/aaf_config/bin/agent.sh"] CMD [] - diff --git a/auth/docker/Dockerfile.core b/auth/docker/Dockerfile.core index 3431ee25..a15039aa 100644 --- a/auth/docker/Dockerfile.core +++ b/auth/docker/Dockerfile.core @@ -17,7 +17,9 @@ # limitations under the License. # ============LICENSE_END==================================================== # -FROM nexus3.onap.org:10001/onap/aaf/aaf-base-xenial:latest +FROM ${DOCKER_REPOSITORY}/onap/aaf/aaf_base:${AAF_VERSION} +#FROM nexus3.onap.org:10001/onap/aaf/aaf_base:${AAF_VERSION} +#FROM nexus3.onap.org:10001/onap/aaf/aaf-base-xenial:latest MAINTAINER AAF Team, AT&T 2018 ENV VERSION=${AAF_VERSION} diff --git a/auth/docker/Dockerfile.ms b/auth/docker/Dockerfile.ms index 9ae40c74..99ac5fca 100644 --- a/auth/docker/Dockerfile.ms +++ b/auth/docker/Dockerfile.ms @@ -17,7 +17,7 @@ # limitations under the License. # ============LICENSE_END==================================================== # -FROM onap/aaf/aaf_core:${AAF_VERSION} +FROM ${DOCKER_REPOSITORY}/onap/aaf/aaf_core:${AAF_VERSION} MAINTAINER AAF Team, AT&T 2018 ENV VERSION=${AAF_VERSION} @@ -26,7 +26,8 @@ LABEL version=${AAF_VERSION} COPY pod/* /opt/app/aaf/pod/ -CMD ["/bin/bash","-c","cd /opt/app/aaf;bin/${AAF_COMPONENT}"] +#CMD ["bash","-c","cd /opt/app/aaf;bin/${AAF_COMPONENT}"] +CMD [] # For Debugging installation # CMD ["/bin/bash","-c","pwd;cd /opt/app/osaaf;find /opt/app/osaaf -depth;df -k; cat /opt/app/aaf/${AAF_COMPONENT}/bin/${AAF_COMPONENT};cat /etc/hosts;/opt/app/aaf/${AAF_COMPONENT}/bin/${AAF_COMPONENT}"] diff --git a/auth/docker/aaf.sh b/auth/docker/aaf.sh index 165b0007..14166a3e 100644 --- a/auth/docker/aaf.sh +++ b/auth/docker/aaf.sh @@ -26,32 +26,28 @@ function run_it() { $DOCKER run $@ \ -v "aaf_config:$CONF_ROOT_DIR" \ -v "aaf_status:/opt/app/aaf/status" \ - --add-host="$HOSTNAME:$HOST_IP" \ - --add-host="aaf.osaaf.org:$HOST_IP" \ - --env HOSTNAME=${HOSTNAME} \ + --env aaf_locator_container=docker \ + --env aaf_locator_fqdn=${HOSTNAME} \ + --env aaf_locate_url=https://aaf-locate:8095 \ --env AAF_ENV=${AAF_ENV} \ - --env AAF_REGISTER_AS=${AAF_REGISTER_AS} \ - --env AAF_LOCATOR_AS=${AAF_LOCATOR_AS} \ --env LATITUDE=${LATITUDE} \ --env LONGITUDE=${LONGITUDE} \ - --env CASS_HOST=${CASS_HOST} \ --env CASSANDRA_CLUSTER=${CASSANDRA_CLUSTER} \ --env CASSANDRA_USER=${CASSANDRA_USER} \ --env CASSANDRA_PASSWORD=${CASSANDRA_PASSWORD} \ --env CASSANDRA_PORT=${CASSANDRA_PORT} \ --name aaf_config_$USER \ $PREFIX${ORG}/${PROJECT}/aaf_config:${VERSION} \ - /bin/bash $PARAMS + bash -c "bash /opt/app/aaf_config/bin/agent.sh $PARAMS" } -PARAMS="$@" +PARAMS=$@ case "$1" in bash) - run_it -it --rm + PARAMS="&& cd /opt/app/osaaf/local && exec bash" + run_it -it --rm ;; - -it) - shift - PARAMS="$@" + taillog) run_it -it --rm ;; *) diff --git a/auth/docker/agent.sh b/auth/docker/agent.sh index 88b8497e..86fee5f6 100644 --- a/auth/docker/agent.sh +++ b/auth/docker/agent.sh @@ -28,9 +28,9 @@ fi . ./aaf.props DOCKER=${DOCKER:=docker} -CADI_VERSION=${CADI_VERSION:=2.1.9-SNAPSHOT} +CADI_VERSION=${CADI_VERSION:=2.1.10-SNAPSHOT} -for V in VERSION DOCKER_REPOSITORY AAF_FQDN AAF_FQDN_IP DEPLOY_FQI APP_FQDN APP_FQI VOLUME DRIVER LATITUDE LONGITUDE; do +for V in VERSION DOCKER_REPOSITORY HOSTNAME AAF_FQDN AAF_FQDN_IP DEPLOY_FQI APP_FQDN APP_FQI VOLUME DRIVER LATITUDE LONGITUDE; do if [ "$(grep $V ./aaf.props)" = "" ]; then unset DEF case $V in @@ -38,6 +38,10 @@ for V in VERSION DOCKER_REPOSITORY AAF_FQDN AAF_FQDN_IP DEPLOY_FQI APP_FQDN APP_ PROMPT="Docker Repo" DEF="" ;; + HOSTNAME) + PROMPT="HOSTNAME (blank for Default)" + DEF="" + ;; AAF_FQDN) PROMPT="AAF's FQDN";; DEPLOY_FQI) PROMPT="Deployer's FQI";; AAF_FQDN_IP) @@ -61,8 +65,10 @@ for V in VERSION DOCKER_REPOSITORY AAF_FQDN AAF_FQDN_IP DEPLOY_FQI APP_FQDN APP_ read -p "$PROMPT" VAR if [ "$VAR" = "" ]; then if [ "$DEF" = "" ]; then - echo "agent.sh needs each value queried. Please start again." - exit + if [ "$V" != "HOSTNAME" ]; then + echo "agent.sh needs each value queried. Please start again." + exit + fi else VAR=$DEF fi diff --git a/auth/docker/components b/auth/docker/components index 0a4a66ad..7f58dc33 100644 --- a/auth/docker/components +++ b/auth/docker/components @@ -1,7 +1,7 @@ service locate oauth -gui -fs cm +gui hello +fs diff --git a/auth/docker/d.props.init b/auth/docker/d.props.init index 2a871bd8..c406b81c 100644 --- a/auth/docker/d.props.init +++ b/auth/docker/d.props.init @@ -21,19 +21,16 @@ ORG=onap PROJECT=aaf DOCKER_REPOSITORY=nexus3.onap.org:10003 -VERSION=2.1.9-SNAPSHOT +VERSION=2.1.10-SNAPSHOT CONF_ROOT_DIR=/opt/app/osaaf # For local builds, set PREFIX= PREFIX="$DOCKER_REPOSITORY/" +NAMESPACE=onap -# Local Env info -HOSTNAME=aaf.osaaf.org -HOST_IP= +# HOSTNAME=aaf.osaaf.org # AAF Machine info AAF_ENV=DEV -AAF_REGISTER_AS=$HOSTNAME -AAF_LOCATE_AS=$AAF_REGISTER_AS LATITUDE= LONGITUDE= @@ -50,7 +47,8 @@ AAF_SIGNER_PASSWORD= AAF_SIGNER_ALIAS= # OPTIONALLY ADD THESE CASSANDRA PROPERTIES -# CASS_HOST= +# Note: Setting "CASSANDRA_DOCKER" will setup the appropriate CASSANDRA_CLUSTER, etc in Docker Properties. +CASSANDRA_DOCKER=aaf-cass # CASSANDRA_CLUSTER= # CASSANDRA_USER= # CASSANDRA_PASSWORD= diff --git a/auth/docker/dbash.sh b/auth/docker/dbash.sh index c91c2494..f3bb26a0 100644 --- a/auth/docker/dbash.sh +++ b/auth/docker/dbash.sh @@ -20,4 +20,4 @@ # . ./d.props -${DOCKER:=docker} exec -it aaf_$1 bash +${DOCKER:=docker} exec -it aaf-$1 bash diff --git a/auth/docker/dbuild.sh b/auth/docker/dbuild.sh index 627be95d..4eb349b9 100755 --- a/auth/docker/dbuild.sh +++ b/auth/docker/dbuild.sh @@ -32,24 +32,39 @@ DOCKER=${DOCKER:=docker} echo "Building Containers for aaf components, version $VERSION" # AAF_cass now needs a version... -cd ../auth-cass/docker -bash ./dbuild.sh -cd - +#cd ../auth-cass/docker +#bash ./dbuild.sh +#cd - + +# AAF Base version - set the core image, etc +sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \ + Dockerfile.base > Dockerfile +$DOCKER build -t ${ORG}/${PROJECT}/aaf_base:${VERSION} . +$DOCKER tag ${ORG}/${PROJECT}/aaf_base:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_base:${VERSION} +$DOCKER tag ${ORG}/${PROJECT}/aaf_base:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_base:latest +rm Dockerfile # Create the AAF Config (Security) Images cd .. cp auth-cmd/target/aaf-auth-cmd-$VERSION-full.jar sample/bin cp -Rf ../conf/CA sample + # AAF Config image (for AAF itself) -sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.config > sample/Dockerfile +sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \ + -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' \ + -e 's/${DOCKER_REPOSITORY}/'${DOCKER_REPOSITORY}'/g' \ + docker/Dockerfile.config > sample/Dockerfile $DOCKER build -t ${ORG}/${PROJECT}/aaf_config:${VERSION} sample $DOCKER tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_config:${VERSION} $DOCKER tag ${ORG}/${PROJECT}/aaf_config:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/latest cp ../cadi/servlet-sample/target/aaf-cadi-servlet-sample-${VERSION}-sample.jar sample/bin # AAF Agent Image (for Clients) -sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' docker/Dockerfile.client > sample/Dockerfile +sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \ + -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' \ + -e 's/${DOCKER_REPOSITORY}/'${DOCKER_REPOSITORY}'/g' \ + docker/Dockerfile.client > sample/Dockerfile $DOCKER build -t ${ORG}/${PROJECT}/aaf_agent:${VERSION} sample $DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:${VERSION} $DOCKER tag ${ORG}/${PROJECT}/aaf_agent:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_agent:latest @@ -63,7 +78,10 @@ cd - # Second, build a core Docker Image echo Building aaf_$AAF_COMPONENT... # Apply currrent Properties to Docker file, and put in place. -sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core >../aaf_${VERSION}/Dockerfile +sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \ + -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' \ + -e 's/${DOCKER_REPOSITORY}/'${DOCKER_REPOSITORY}'/g' \ + Dockerfile.core >../aaf_${VERSION}/Dockerfile cd .. $DOCKER build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION} $DOCKER tag ${ORG}/${PROJECT}/aaf_core:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_core:${VERSION} @@ -80,11 +98,13 @@ else AAF_COMPONENTS=$1 fi -mkdir -p ../aaf_${VERSION}/pod -cp ../sample/bin/pod_wait.sh ../aaf_${VERSION}/pod +cp ../sample/bin/pod_wait.sh ../aaf_${VERSION}/bin for AAF_COMPONENT in ${AAF_COMPONENTS}; do echo Building aaf_$AAF_COMPONENT... - sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms >../aaf_${VERSION}/Dockerfile + sed -e 's/${AAF_VERSION}/'${VERSION}'/g' \ + -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' \ + -e 's/${DOCKER_REPOSITORY}/'${DOCKER_REPOSITORY}'/g' \ + Dockerfile.ms >../aaf_${VERSION}/Dockerfile cd .. $DOCKER build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION} $DOCKER tag ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} @@ -93,5 +113,4 @@ for AAF_COMPONENT in ${AAF_COMPONENTS}; do cd - done -rm ../aaf_${VERSION}/pod/* -rmdir ../aaf_${VERSION}/pod +rm ../aaf_${VERSION}/bin/pod_wait.sh diff --git a/auth/docker/drun.sh b/auth/docker/drun.sh index 9f770055..ed62e573 100644 --- a/auth/docker/drun.sh +++ b/auth/docker/drun.sh @@ -18,29 +18,11 @@ # limitations under the License. # ============LICENSE_END==================================================== # -# Validate for realtime Cassandra info - -# check if outside Cluster defined... otherwise, set CASS_HOST for using expected Docker based Cass -if [ -z "$(grep -e '^CASS_CLUSTER=.*' d.props)" ]; then - if [ "$(uname)" = "Darwin" ]; then - SED="sed -i .bak" - else - SED="sed -i" - fi - - CASSANDRA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' aaf_cass) - if [ -z "$(grep -e '^CASS_HOST.*' d.props)" ]; then - $SED "s/# CASS_HOST=.*/CASS_HOST=cass.aaf.osaaf.org:$CASSANDRA_IP/" d.props - else - $SED "s/CASS_HOST=.*/CASS_HOST=cass.aaf.osaaf.org:$CASSANDRA_IP/" d.props - fi - echo "Updated d.props for CASSANDRA Name/IP" - grep -e '^CASS_HOST.*' d.props -fi - # Pull in Variables from d.props . ./d.props +CASSANDRA_CLUSTER=${CASSANDRA_CLUSTER:=$CASSANDRA_DOCKER} + DOCKER=${DOCKER:=docker} # Running without params keeps from being TTY @@ -55,83 +37,77 @@ fi for AAF_COMPONENT in ${AAF_COMPONENTS}; do LINKS="" CMD_LINE="" - PORTMAP="" + PUBLISH="" case "$AAF_COMPONENT" in "service") - PORTMAP="8100:8100" - LINKS="--link aaf_cass:cassandra " - # CASS_HOST is for Container based Cassadra - if [ -z "$CASS_HOST" ]; then - CMD_LINE="/bin/bash /opt/app/aaf/pod/pod_wait.sh aaf_service sleep 0 cd /opt/app/aaf;bin/service" + PUBLISH="--publish 8100:8100" + if [ -z "$CASSANDRA_DOCKER" ]; then + CMD_LINE="cd /opt/app/aaf && /bin/bash pod/pod_wait.sh aaf-service && exec bin/service" else - CMD_LINE="/bin/bash /opt/app/aaf/pod/pod_wait.sh aaf_service aaf_cass cd /opt/app/aaf;bin/service" + CMD_LINE="cd /opt/app/aaf && /bin/bash pod/pod_wait.sh aaf-service aaf-cass && exec bin/service" + LINKS="--link $CASSANDRA_DOCKER" + echo $CASSANDRA_CLUSTER fi ;; "locate") - PORTMAP="8095:8095" - LINKS="--link aaf_cass:cassandra " - CMD_LINE="/bin/bash /opt/app/aaf/pod/pod_wait.sh aaf_locate aaf_service cd /opt/app/aaf;bin/locate" + PUBLISH="--publish 8095:8095" + LINKS="--link aaf-cass --link aaf-service" + CMD_LINE="cd /opt/app/aaf && /bin/bash pod/pod_wait.sh aaf-locate aaf-service && exec bin/locate" ;; "oauth") - PORTMAP="8140:8140" - LINKS="--link aaf_cass:cassandra " - CMD_LINE="/bin/bash /opt/app/aaf/pod/pod_wait.sh aaf_oauth aaf_service cd /opt/app/aaf;bin/oauth" - ;; - "gui") - PORTMAP="8200:8200" - LINKS="" - CMD_LINE="/bin/bash /opt/app/aaf/pod/pod_wait.sh aaf_gui aaf_locate cd /opt/app/aaf;bin/gui" + PUBLISH="--publish 8140:8140" + LINKS="--link aaf-cass --link aaf-service --link aaf-locate" + CMD_LINE="cd /opt/app/aaf && /bin/bash pod/pod_wait.sh aaf-oauth aaf-service && exec bin/oauth" ;; "cm") - PORTMAP="8150:8150" - LINKS="--link aaf_cass:cassandra " - CMD_LINE="/bin/bash /opt/app/aaf/pod/pod_wait.sh aaf_cm aaf_locate cd /opt/app/aaf;bin/cm" + PUBLISH="--publish 8150:8150" + LINKS="--link aaf-cass --link aaf-service --link aaf-locate" + CMD_LINE="cd /opt/app/aaf && /bin/bash pod/pod_wait.sh aaf-cm aaf-locate && exec bin/cm" ;; - "hello") - PORTMAP="8130:8130" - LINKS="" - CMD_LINE="/bin/bash /opt/app/aaf/pod/pod_wait.sh aaf_hello aaf_locate cd /opt/app/aaf;bin/hello" + "gui") + PUBLISH="--publish 8200:8200" + LINKS="--link aaf-service --link aaf-locate --link aaf-oauth --link aaf-cm" + CMD_LINE="cd /opt/app/aaf && /bin/bash pod/pod_wait.sh aaf-gui aaf-locate && exec bin/gui" ;; "fs") - PORTMAP="80:8096" + PUBLISH="--publish 80:8096" LINKS="" - CMD_LINE="/bin/bash /opt/app/aaf/pod/pod_wait.sh aaf_fs aaf_locate cd /opt/app/aaf;bin/fs" + CMD_LINE="cd /opt/app/aaf && /bin/bash pod/pod_wait.sh aaf-fs aaf-locate && exec bin/fs" + ;; + "hello") + PUBLISH="--publish 8130:8130" + LINKS="--link aaf-service --link aaf-locate --link aaf-oauth --link aaf-cm" + CMD_LINE="cd /opt/app/aaf && /bin/bash pod/pod_wait.sh aaf-hello aaf-locate && exec bin/hello" ;; esac - echo Starting aaf_$AAF_COMPONENT... - - if [ -n "$AAF_REGISTER_AS" ] && [ "$HOSTNAME" != "$AAF_REGISTER_AS" ]; then - AH_ROOT="$HOSTNAME $AAF_REGISTER_AS" - else - AH_ROOT="$HOSTNAME" - fi + echo Starting aaf-$AAF_COMPONENT... - for A in aaf.osaaf.org $AH_ROOT; do - ADD_HOST="$ADD_HOST --add-host=$A:$HOST_IP" - done + #for A in aaf.osaaf.org $AH_ROOT; do + #ADD_HOST="$ADD_HOST --add-host=$A:$HOST_IP" + #done - if [ ! -z "$LINKS" ] && [[ "$CASS_HOST" =~ ":" ]]; then - ADD_HOST="$ADD_HOST --add-host=$CASS_HOST" - fi - $DOCKER run \ + #if [ ! -z "$LINKS" ] && [[ "$CASS_HOST" =~ ":" ]]; then + #ADD_HOST="$ADD_HOST --add-host=$CASS_HOST" + #fi + #--hostname="${AAF_COMPONENT}.${NAMESPACE}" \ + # $ADD_HOST \ + $DOCKER run \ -d \ - --name aaf_$AAF_COMPONENT \ - --hostname="${AAF_COMPONENT}.aaf.osaaf.org" \ - $ADD_HOST \ + --name aaf-$AAF_COMPONENT \ ${LINKS} \ --env AAF_ENV=${AAF_ENV} \ - --env AAF_REGISTER_AS=${AAF_REGISTER_AS} \ + --env aaf_locator_container=docker \ + --env aaf_locator_fqdn=$HOSTNAME \ --env LATITUDE=${LATITUDE} \ --env LONGITUDE=${LONGITUDE} \ - --env CASS_HOST=${CASS_HOST} \ --env CASSANDRA_CLUSTER=${CASSANDRA_CLUSTER} \ --env CASSANDRA_USER=${CASSANDRA_USER} \ --env CASSANDRA_PASSWORD=${CASSANDRA_PASSWORD} \ --env CASSANDRA_PORT=${CASSANDRA_PORT} \ - --publish $PORTMAP \ + $PUBLISH \ -v "aaf_config:$CONF_ROOT_DIR" \ -v "aaf_status:/opt/app/aaf/status" \ ${PREFIX}${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} \ - $CMD_LINE + /bin/bash -c "$CMD_LINE" done diff --git a/auth/docker/dstart.sh b/auth/docker/dstart.sh index 9242e46a..1bd90d5e 100644 --- a/auth/docker/dstart.sh +++ b/auth/docker/dstart.sh @@ -30,5 +30,5 @@ else fi for AAF_COMPONENT in ${AAF_COMPONENTS}; do - $DOCKER start aaf_$AAF_COMPONENT + $DOCKER start aaf-$AAF_COMPONENT done diff --git a/auth/docker/dstop.sh b/auth/docker/dstop.sh index cebf4ebf..4d302bd1 100644 --- a/auth/docker/dstop.sh +++ b/auth/docker/dstop.sh @@ -29,5 +29,5 @@ else fi for AAF_COMPONENT in ${AAF_COMPONENTS}; do - $DOCKER stop aaf_$AAF_COMPONENT + $DOCKER stop aaf-$AAF_COMPONENT done |