Parametrize variants at build scripts
[anna.git] / example / diameter / launcher / deploy-adml-http.sh
index 3ee0e58..97c5d72 100755 (executable)
@@ -6,6 +6,8 @@
 SCR_DIR=`readlink -f $0 | xargs dirname`
 PROJECT_ROOT=$(readlink -f $SCR_DIR/../../..)
 
+VARIANT=${1:-Release}
+
 #############
 # FUNCTIONS #
 #############
@@ -29,9 +31,9 @@ echo "------------------------------------------------------"
 echo "         ADML with HTTP support installation          "
 echo "------------------------------------------------------"
 echo
-[ -d $PROJECT_ROOT/build/Release ] && VARIANT=Release
-[ -d $PROJECT_ROOT/build/Debug ] && VARIANT=Debug
-[ -z "$VARIANT" ] && _exit "Cannot locate neither 'Release' nor 'Debug' variant !"
+[ ! -d $PROJECT_ROOT/build/${VARIANT} ] && _exit "Cannot locate neither '${VARIANT}' variant. Build the project !"
+echo "Variant: ${VARIANT}"
+echo
 build_type_letter=$(echo $VARIANT | cut -c1 | tr '[:upper:]' '[:lower:]')
 
 version__dflt=v"`date +'%y'`.`date +'%m'`.`date +'%d'`$build_type_letter"
@@ -71,7 +73,7 @@ mkdir -p ${ADML}/counters
 mkdir -p ${ADML}/test-reports
 
 # Scripts:
-cp ${PROJECT_ROOT}/example/diameter/launcher/resources/scripts/operation_curl.sh ${ADML}/operation.sh
+cp ${PROJECT_ROOT}/example/diameter/launcher/resources/scripts/operation.sh ${ADML}
 
 # Templates:
 mkdir $DTDs
@@ -107,11 +109,21 @@ ln -sf default/libanna_launcher_procedure_default_shared.so
 cd - >/dev/null
 
 # ADML Agent shall use http server:
-httpOpt="--httpServer \`grep -v ^# .httpServer\`"
+httpOpt="--httpServerShared --httpServer \`grep -v ^# .httpServer\`"
 echo "${httpOpt}" >> ${ADML}/args.ft
 echo "${httpOpt}" >> ${ADML}/args.st
 echo "localhost:8000" > ${ADML}/.httpServer
 
+# Help
+cp ${PROJECT_ROOT}/example/diameter/launcher/resources/HELP.md ${ADML}
+
+# Simple services which only loads the diameter base dictionary:
+cat << EOF > ${ADML}/services.xml
+<services>
+  <stack id="0" dictionary="stacks/diameter_base.0.xml" fixMode="Never"/>
+</services>
+EOF
+
 # Remove AOTS actions:
 rm ${ADML}/ACTIONS.md