From ebd820491574c758104c09ca06bf3347ed87c88f Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Mon, 17 Apr 2017 19:33:09 +0200 Subject: [PATCH] Centralize ADML deployment --- .../{DEPLOY_setups.sh => deploy-setups.sh} | 25 +++++++++------ .../launcher/{DEPLOY.sh => deploy.sh} | 32 ++++++++++--------- .../launcher/deployments/advanced/README | 11 +++---- .../launcher/deployments/basic/README | 2 +- .../launcher/deployments/basic/configure.sh | 4 +-- .../launcher/deployments/ft-client/README | 2 +- .../launcher/deployments/st-client/README | 2 +- .../deployments/st-client/configure.sh | 2 +- example/postinstall.sh | 4 +-- 9 files changed, 46 insertions(+), 38 deletions(-) rename example/diameter/launcher/{DEPLOY_setups.sh => deploy-setups.sh} (89%) rename example/diameter/launcher/{DEPLOY.sh => deploy.sh} (88%) diff --git a/example/diameter/launcher/DEPLOY_setups.sh b/example/diameter/launcher/deploy-setups.sh similarity index 89% rename from example/diameter/launcher/DEPLOY_setups.sh rename to example/diameter/launcher/deploy-setups.sh index dab557d..526ff79 100755 --- a/example/diameter/launcher/DEPLOY_setups.sh +++ b/example/diameter/launcher/deploy-setups.sh @@ -3,7 +3,7 @@ ############# # VARIABLES # ############# -DEPLOY_SCR=`dirname $0`/DEPLOY.sh +DEPLOY_SCR=`dirname $0`/deploy.sh ############# # FUNCTIONS # @@ -33,6 +33,7 @@ echo " type:" echo " 1. Client and server" echo " 2. Ft-client and server" echo " 3. St-client and servers" +echo " 4. Single deployment" echo echo " target_directory:" echo @@ -59,6 +60,11 @@ case $type in DEPLOY_DIR__dflt=$HOME/ADML-stclientAndServers ;; + 4) + echo "Selected single deployment" + DEPLOY_DIR__dflt=$HOME/ADML-single + ;; + *) echo "Unknown option!" exit 1 @@ -99,14 +105,6 @@ case $type in $DEPLOY_SCR b $target/ADML-serverGx $DEPLOY_SCR b $target/ADML-serverRx echo "Configuring ..." -# cd $target/ADML-st-client -# ln -s services_example services -# mv run.sh .run-one.sh -# mv run_all.sh run.sh -# mv operation.sh .operation-one.sh -# mv operation_all.sh operation.sh -# rm dictionary.xml -# cd - >/dev/null cd $target/ADML-serverGx echo s | ./configure.sh >/dev/null sed -i 's/3868/3869/' services.xml @@ -119,6 +117,15 @@ case $type in ln -sf stacks/other_examples/16777236.xml dictionary.xml cd - >/dev/null ;; + + 4) + $DEPLOY_SCR b $target + echo "Configuring ..." + cd $target + echo d | ./configure.sh >/dev/null + cd - >/dev/null + ;; + esac echo diff --git a/example/diameter/launcher/DEPLOY.sh b/example/diameter/launcher/deploy.sh similarity index 88% rename from example/diameter/launcher/DEPLOY.sh rename to example/diameter/launcher/deploy.sh index 7e19fff..cb7c169 100755 --- a/example/diameter/launcher/DEPLOY.sh +++ b/example/diameter/launcher/deploy.sh @@ -9,6 +9,7 @@ SETUPS_DIR=$PROJECT_ROOT/source/diameter/stack/setups MSGDTD=$PROJECT_ROOT/include/anna/diameter/codec/message.dtd DCTDTD=$PROJECT_ROOT/include/anna/diameter/stack/dictionary.dtd SERVICES=$SCR_DIR/resources/services_examples +SCRIPTS=$SCR_DIR/resources/scripts STACK_EXAMPLES=$SCR_DIR/resources/stack_examples SRVDTD=$SERVICES/services.dtd VARIANT= @@ -48,8 +49,8 @@ createRunScript () { local other= [ "$1" = "a" ] && other="--httpServer \`grep -v ^# .httpServer\`" - [ "$1" = "f" ] && ln -s ADML-launcher $EXE - [ "$1" = "s" ] && { other="--disableLogs"; ln -s ADML-launcher $EXE ; } + [ "$1" = "f" ] && ln -s ADML $EXE + [ "$1" = "s" ] && { other="--disableLogs"; ln -s ADML $EXE ; } echo "Creating 'run.sh' script ..." @@ -157,7 +158,6 @@ EXE=`basename $DPATH` echo "Copying to '$DPATH' ..." mkdir -p $DPATH -mkdir -p $DPATH/stacks mkdir -p $DPATH/DTDs mkdir -p $DPATH/counters mkdir -p $DPATH/test-reports @@ -200,27 +200,29 @@ cd - >/dev/null # Basic setup: [ "$option" = "b" ] && mkdir -p $DPATH/services -# Copy executables: -cp $ADML_EXEC $DPATH/ADML-launcher -[ ! -f $DPATH/stacks/stack-mgmt ] && cp $STACKMGMT_EXEC $DPATH/stacks/stack-mgmt - # Copy resources: cp -rL $DEPLOYMENTS_DIR/* $DPATH -cp $SETUPS_DIR/*xml $DPATH/stacks -cp $SETUPS_DIR/*sh $DPATH/stacks -cp $SETUPS_DIR/readme.txt $DPATH/stacks -mkdir $DPATH/stacks/other_examples -cp $STACK_EXAMPLES/* $DPATH/stacks/other_examples +mkdir -p $DPATH/stack_examples/other +cp $STACK_EXAMPLES/* $DPATH/stack_examples/other +cp $SETUPS_DIR/*xml $DPATH/stack_examples +cp $SETUPS_DIR/*sh $DPATH/stack_examples +cp $SETUPS_DIR/readme.txt $DPATH/stack_examples cp $MSGDTD $DPATH/DTDs cp $DCTDTD $DPATH/DTDs cp $SRVDTD $DPATH/DTDs [ "$option" = "b" ] && cp $SERVICES/* $DPATH/services +cp $SCRIPTS/clone.sh $DPATH +cp $SCRIPTS/tinyTestcase.sh $DPATH + +# Copy executables: +cp $ADML_EXEC $DPATH/ADML +[ ! -f $DPATH/stack_examples/stack-mgmt ] && cp $STACKMGMT_EXEC $DPATH/stack_examples/stack-mgmt -echo "Preparing ..." +echo "Default stack dynamic generation ..." cd $DPATH createRunScript $option -stacks/makeAutonomous.sh commands_qosControl.xml stacks/stack-mgmt >/dev/null -ln -s stacks/autonomous.commands_qosControl.xml dictionary.xml +stack_examples/makeAutonomous.sh commands_qosControl.xml stack_examples/stack-mgmt >/dev/null +ln -s stack_examples/autonomous.commands_qosControl.xml dictionary.xml cd - >/dev/null if [ "$option" = "s" ] diff --git a/example/diameter/launcher/deployments/advanced/README b/example/diameter/launcher/deployments/advanced/README index 3b59438..404524b 100644 --- a/example/diameter/launcher/deployments/advanced/README +++ b/example/diameter/launcher/deployments/advanced/README @@ -1,7 +1,7 @@ ABOUT CONTENT ------------- -Stacks available at './stacks'. The launcher uses 'dictionary.xml' created ad-hoc by default. +Stacks at './stack_examples'. The launcher uses 'dictionary.xml' created ad-hoc by default. It is a QoS application dictionary. Template for xml messages (message.dtd), dictionaries (dictionary.dtd) and services (services.dtd) @@ -10,13 +10,12 @@ are informative, not actually required by process. Located at './DTDs'. STARTING THE PROCESS -------------------- Start with 'run.sh'. You could manually edit such script adding parameters as '--trace debug' to -get complete 'launcher.trace'. Execute 'ADML-launcher' without arguments to see a complete -command-line help. +get complete 'launcher.trace'. Execute 'ADML' without arguments to see a complete command-line help. DEPLOYED SCRIPTS ---------------- You could get help about installed resources by mean 'help.sh', which launch a help request to -the started ADML-launcher process http interface. All the implemented http operations could be -launched through a script to make easy use. The http client 'curl' is used by default due to -its presence on common linux distributions. +the started ADML process http interface. All the implemented http operations could be launched +through a script to make easy use. The http client 'curl' is used by default due to its presence +on common linux distributions. diff --git a/example/diameter/launcher/deployments/basic/README b/example/diameter/launcher/deployments/basic/README index 8a0b83c..6a51e4a 100644 --- a/example/diameter/launcher/deployments/basic/README +++ b/example/diameter/launcher/deployments/basic/README @@ -2,7 +2,7 @@ ABOUT CONTENT ------------- Template for xml messages (message.dtd), dictionaries (dictionary.dtd) and services (services.dtd) are informative, not actually required by process. They are located at './DTDs'. Stacks are available -at './stacks'. There are also some stuff (hex/xml examples, etc.) which could be useful. +at './stack_examples'. There are also some stuff (hex/xml examples, etc.) which could be useful. Firstly you have to configure this directory in order to choose the type of launcher which will be preconfigured for your basic needs: client, server, balancer (proxy) and dummy process (this diff --git a/example/diameter/launcher/deployments/basic/configure.sh b/example/diameter/launcher/deployments/basic/configure.sh index f03eca7..5257578 100755 --- a/example/diameter/launcher/deployments/basic/configure.sh +++ b/example/diameter/launcher/deployments/basic/configure.sh @@ -5,7 +5,7 @@ ############# # General -EXE_BN=ADML-launcher +EXE_BN=ADML ############# # FUNCTIONS # @@ -90,7 +90,7 @@ fi # Run script: EXE_LINK=`basename $PWD` -ln -sf $EXE_BN $EXE_LINK +[ "$EXE_BN" != "$EXE_LINK" ] && ln -sf $EXE_BN $EXE_LINK case $tol in diff --git a/example/diameter/launcher/deployments/ft-client/README b/example/diameter/launcher/deployments/ft-client/README index d538a77..ff22c92 100644 --- a/example/diameter/launcher/deployments/ft-client/README +++ b/example/diameter/launcher/deployments/ft-client/README @@ -2,7 +2,7 @@ ABOUT CONTENT ------------- Template for xml messages (message.dtd), dictionaries (dictionary.dtd) and services (services.dtd) are informative, not actually required by process. They are located at './DTDs'. Stacks are available -at './stacks'. There are also some stuff (hex/xml examples, etc.) which could be useful. +at './stack_examples'. There are also some stuff (hex/xml examples, etc.) which could be useful. The directory 'tests' contains resources to create FT test cases. The script 'common.sh' implement a basic scheduler to launch a request to the server, waits for incoming activity, retrieve the diff --git a/example/diameter/launcher/deployments/st-client/README b/example/diameter/launcher/deployments/st-client/README index 73b32c2..d6f4f5b 100644 --- a/example/diameter/launcher/deployments/st-client/README +++ b/example/diameter/launcher/deployments/st-client/README @@ -2,7 +2,7 @@ ABOUT CONTENT ------------- Template for xml messages (message.dtd), dictionaries (dictionary.dtd) and services (services.dtd) are informative, not actually required by -process. They are located at './DTDs'. Stacks are available at './stacks'. +process. They are located at './DTDs'. Stacks at './stack_examples'. There are also some stuff (hex/xml examples, etc.) which could be useful. You could adapt your 'services' configuration using stuff from dynamic diff --git a/example/diameter/launcher/deployments/st-client/configure.sh b/example/diameter/launcher/deployments/st-client/configure.sh index 21e3112..17bff02 100755 --- a/example/diameter/launcher/deployments/st-client/configure.sh +++ b/example/diameter/launcher/deployments/st-client/configure.sh @@ -247,7 +247,7 @@ do ln -s ../../pre-start.sh cp ../../.run-one.sh run.sh sed -i 's/^EXE=.*/EXE=ADML-'$instance'/' run.sh - ln -s ../../ADML-launcher ADML-$instance + ln -s ../../ADML ADML-$instance for xml in `ls ../../services/*xml`; do ln -s $xml; done cd - >/dev/null done diff --git a/example/postinstall.sh b/example/postinstall.sh index 351789d..bbe59fe 100755 --- a/example/postinstall.sh +++ b/example/postinstall.sh @@ -8,10 +8,10 @@ Post-installation procedure =========================== Execute multiple-deployment scripts by mean: - example/diameter/launcher/DEPLOY_setups.sh + example/diameter/launcher/deploy-setups.sh Or single endpoints using: - example/diameter/launcher/DEPLOY.sh + example/diameter/launcher/deploy.sh -- 2.20.1