diff options
Diffstat (limited to 'plans/aaf/certservice/setup.sh')
-rw-r--r-- | plans/aaf/certservice/setup.sh | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/plans/aaf/certservice/setup.sh b/plans/aaf/certservice/setup.sh index 1bf57470..dde516ae 100644 --- a/plans/aaf/certservice/setup.sh +++ b/plans/aaf/certservice/setup.sh @@ -15,31 +15,47 @@ # limitations under the License. # -AAFCERT_IMAGE=nexus3.onap.org:10001/onap/org.onap.aaf.certservice.aaf-certservice-api:latest - -echo AAFCERT_IMAGE=${AAFCERT_IMAGE} - # ------------------------------------ -# Resolve path to cmp servers configuration +# Resolve path to script's directory and cmp servers configuration SCRIPT=`realpath $0` CURRENT_WORKDIR_PATH=`dirname $SCRIPT` +PROJECT_DIRECTORY="plans/aaf/certservice" + +SCRIPTS_DIRECTORY="scripts" + +JENKINS_SCRIPTS_PATH="$CURRENT_WORKDIR_PATH/$PROJECT_DIRECTORY/$SCRIPTS_DIRECTORY" +LOCAL_SCRIPTS_PATH="$CURRENT_WORKDIR_PATH/$SCRIPTS_DIRECTORY" + +if test -d "$JENKINS_SCRIPTS_PATH"; then + SCRIPTS_PATH=$JENKINS_SCRIPTS_PATH +else test -f "$LOCAL_SCRIPTS_PATH"; + SCRIPTS_PATH=$LOCAL_SCRIPTS_PATH +fi +echo "Use scripts from: $SCRIPTS_PATH" CONFIGURATION_FILE="cmpServers.json" -if test -f "$CURRENT_WORKDIR_PATH/plans/aaf/certservice/$CONFIGURATION_FILE"; then - CONFIGURATION_PATH="$CURRENT_WORKDIR_PATH/plans/aaf/certservice/$CONFIGURATION_FILE" -else test -f "$CURRENT_WORKDIR_PATH/$CONFIGURATION_FILE"; - CONFIGURATION_PATH=$CURRENT_WORKDIR_PATH/$CONFIGURATION_FILE + +JENKINS_CONFIGURATION_PATH="$CURRENT_WORKDIR_PATH/$PROJECT_DIRECTORY/$CONFIGURATION_FILE" +LOCAL_CONFIGURATION_PATH="$CURRENT_WORKDIR_PATH/$CONFIGURATION_FILE" + +if test -f "$JENKINS_CONFIGURATION_PATH"; then + CONFIGURATION_PATH="$JENKINS_CONFIGURATION_PATH" +else test -f "$LOCAL_CONFIGURATION_PATH"; + CONFIGURATION_PATH=$LOCAL_CONFIGURATION_PATH fi echo "Use configuration from: $CONFIGURATION_PATH" + # ------------------------------------- -# Start AAF Cert Srevice -docker run -p 8080:8080 -d --mount type=bind,source=${CONFIGURATION_PATH},target=/etc/onap/aaf/certservice/cmpServers.json --name aafcert ${AAFCERT_IMAGE} +export CONFIGURATION_PATH=${CONFIGURATION_PATH} +export SCRIPTS_PATH=${SCRIPTS_PATH} + +docker-compose up -d AAFCERT_IP=`get-instance-ip.sh aafcert` export AAFCERT_IP=${AAFCERT_IP} # Wait container ready -sleep 5 +sleep 15 |