Skip to content
Snippets Groups Projects
Verified Commit a8b734e3 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

add analytics boolean in shell script

parent 60565c60
No related branches found
No related tags found
No related merge requests found
......@@ -7,28 +7,30 @@ dockerPort="9000"
helpFunction()
{
echo ""
echo "Usage: $0 -d parameterDate -n parameterName"
echo "Usage: $0 -d parameterDate -n parameterName -a parameterAnalytics"
echo -e "\t-d Date of presentation"
echo -e "\t-n Name of presentation"
echo -e "\t-a [yes/no] for integration of analytics"
exit 1 # Exit script after printing help
}
while getopts "d:n:" opt
while getopts "d:n:a:" opt
do
case "$opt" in
d ) parameterDate="$OPTARG" ;;
n ) parameterName="$OPTARG" ;;
a ) parameterAnalytics="$OPTARG" ;;
? ) helpFunction ;; # Print helpFunction in case parameter is non-existent
esac
done
# Print helpFunction in case parameters are empty
if [ -z "$parameterDate" ] || [ -z "$parameterName" ]
if [ -z "$parameterDate" ] || [ -z "$parameterName" ] || [ -z "$parameterAnalytics" ]
then
echo "Some or all of the parameters are empty";
helpFunction
fi
# launch the docker file
cmd="python contribute.py --date=\"$parameterDate\" --name=\"$parameterName\""
cmd="python contribute.py --date=\"$parameterDate\" --name=\"$parameterName\" --analytics=\"$parameterAnalytics\""
docker run -p $dockerPort:$dockerPort --user $(id -u):$(id -g) -it -v $(pwd)/:/presentation $dockerImg /bin/bash -c "$cmd"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment