X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=scriptversion%2Fdocker-compose%2Fstart.sh;fp=scriptversion%2Fdocker-compose%2Fstart.sh;h=419bef19882541bca9e3f8a1199e6af7f21906e8;hb=c78feeaed2f5889816e938328646397ae0e18c71;hp=0000000000000000000000000000000000000000;hpb=46a6d054a6efcae4d249efe79a13bccb1b0252fc;p=nonrtric%2Frapp%2Forufhrecovery.git diff --git a/scriptversion/docker-compose/start.sh b/scriptversion/docker-compose/start.sh new file mode 100644 index 0000000..419bef1 --- /dev/null +++ b/scriptversion/docker-compose/start.sh @@ -0,0 +1,51 @@ +# Copyright (C) 2021 Nordix Foundation. 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================================================= +# + +SHELL_FOLDER=$(cd "$(dirname "$0")";pwd) +docker stop $(docker ps -aq) +docker system prune -f + +# build o-ru application image +cd ${SHELL_FOLDER}/../app/ +docker build -t oru-app . + +# build simulator image of sdnr +cd ${SHELL_FOLDER}/../simulators/ +docker build -f Dockerfile-sdnr-sim -t sdnr-simulator . + +# build message generator image +docker build -f Dockerfile-message-generator -t message-generator . + +# start up dmaap message router +cd ${SHELL_FOLDER}/../../../../../docker-compose/ +docker-compose -f docker-compose.yaml -f mr/docker-compose.yml up -d + +# wait until mr up & running +for i in {1..60}; do + res=$(curl -o /dev/null -sw %{http_code} http://localhost:3904/topics) + echo "$res" + expect="200" + if [ "$res" == "$expect" ]; then + echo -e "dmaap-mr is alive!\n" + break; + else + sleep $i + fi +done + +# start up oru, message-generator and sdnr-simulator +cd ${SHELL_FOLDER} +docker-compose up -d \ No newline at end of file