X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=near-rt-ric-simulator%2Ftest%2FOSC_2.1.0%2Fbuild_and_start.sh;h=db27d492010d008a7b0e638b65c9e94494bedcaa;hb=HEAD;hp=89907d6093ab1e6f279e65af39fa74dcfdc04d06;hpb=109f3f55a3f0eaac94a9b6954fe2f3db611a991d;p=sim%2Fa1-interface.git diff --git a/near-rt-ric-simulator/test/OSC_2.1.0/build_and_start.sh b/near-rt-ric-simulator/test/OSC_2.1.0/build_and_start.sh index 89907d6..db27d49 100755 --- a/near-rt-ric-simulator/test/OSC_2.1.0/build_and_start.sh +++ b/near-rt-ric-simulator/test/OSC_2.1.0/build_and_start.sh @@ -1,7 +1,7 @@ #!/bin/bash # ============LICENSE_START=============================================== -# Copyright (C) 2020 Nordix Foundation. All rights reserved. +# 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. @@ -18,15 +18,22 @@ # # Script to build and start the container -# Args: nonsecure|secure +# Make sure to run the simulator with the same arg as this script -if [ $# -ne 1 ]; then - echo "Usage: ./build_and_start.sh nonsecure|secure" +print_usage() { + echo "Usage: ./build_and_start.sh duplicate-check|ignore-duplicate " exit 1 +} + +if [ $# -ne 1 ]; then + print_usage fi -if [ "$1" != "nonsecure" ] && [ "$1" != "secure" ]; then - echo "Usage: ./build_and_start.sh nonsecure|secure" - exit 1 +if [ $1 == "duplicate-check" ]; then + DUP_CHECK=1 +elif [ $1 == "ignore-duplicate" ]; then + DUP_CHECK=0 +else + print_usage fi echo "Building image" @@ -35,12 +42,10 @@ cd ../../ #Build the image docker build -t a1test . -echo "Starting $1 mode" -if [ $1 == "nonsecure" ]; then - #Run the container in interactive mode, unsecure port - docker run -it -p 8085:8085 -e A1_VERSION=OSC_2.1.0 -e REMOTE_HOSTS_LOGGING=1 a1test -else - #Run the container in interactive mode, secure port. - docker run -it -p 8185:8185 -e A1_VERSION=OSC_2.1.0 -e REMOTE_HOSTS_LOGGING=1 --read-only --volume "$PWD/certificate:/usr/src/app/cert" a1test -fi +docker stop a1OscSimulator > /dev/null 2>&1 +docker rm -f a1OscSimulator > /dev/null 2>&1 + +echo "Starting ric-sim" +#Run the container in interactive mode, unsecure port 8085, secure port 8185. +docker run --rm -it -p 8085:8085 -p 8185:8185 -e A1_VERSION=OSC_2.1.0 -e ALLOW_HTTP=true -e REMOTE_HOSTS_LOGGING=1 -e DUPLICATE_CHECK=$DUP_CHECK --volume "$PWD/certificate:/usr/src/app/cert" --name a1OscSimulator a1test