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

add contribute shell

parent 1f4f417f
No related branches found
No related tags found
2 merge requests!58Regular merge of develop,!57Docker system
#!/bin/bash
# set the variables
dockerImg="git-r3lab.uni.lu:4567/r3/docker/nodejs-yarn-grunt"
dockerPort="9000"
helpFunction()
{
echo ""
echo "Usage: $0 -d parameterDate -n parameterName"
echo -e "\t-d Data of presentation"
echo -e "\t-n Name of presentation"
exit 1 # Exit script after printing help
}
while getopts "d:n:" opt
do
case "$opt" in
d ) parameterDate="$OPTARG" ;;
n ) parameterName="$OPTARG" ;;
? ) helpFunction ;; # Print helpFunction in case parameter is non-existent
esac
done
# Print helpFunction in case parameters are empty
if [ -z "$parameterDate" ] || [ -z "$parameterName" ]
then
echo "Some or all of the parameters are empty";
helpFunction
fi
# launch the docker file
cmd="python contribute.py --date=\"$parameterDate\" --name=\"$parameterName\""
docker run -p $dockerPort:$dockerPort -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