|
@@ -0,0 +1,58 @@
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+this_script_directory=$(cd `dirname $0` && pwd)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+source $this_script_directory/my_config.sh;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+if [ -z ${python_virtual_environment} ];
|
|
|
|
+then
|
|
|
|
+ printf "Please set in \"my_config.sh\" the path to bot python \
|
|
|
|
+virtual environment\n\
|
|
|
|
+\n\
|
|
|
|
+Example:\n\
|
|
|
|
+python_virtual_environment=\"path/to/virtual/env\"\n\
|
|
|
|
+";
|
|
|
|
+ exit;
|
|
|
|
+fi
|
|
|
|
+if [ -z ${python_script} ];
|
|
|
|
+then
|
|
|
|
+ printf "Please set in \"my_config.sh\" the path to python script to be run \
|
|
|
|
+\n\
|
|
|
|
+Example:\n\
|
|
|
|
+python_script=\"path/to/python/script.py\"\n\
|
|
|
|
+";
|
|
|
|
+ exit;
|
|
|
|
+elif [ ! -e ${python_script} ];
|
|
|
|
+then
|
|
|
|
+ printf "File $python_script does not exist\n\
|
|
|
|
+Please point to a valid file.\n\
|
|
|
|
+Example:\n\
|
|
|
|
+python_script=\"path/to/python/script.py\"\n\
|
|
|
|
+";
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+echo "Python script will be run while it exits with value===65.";
|
|
|
|
+i=65;
|
|
|
|
+while [ $i -eq 65 ]
|
|
|
|
+do
|
|
|
|
+ echo "Pulling from repository..."
|
|
|
|
+ git pull;
|
|
|
|
+ echo "Updating dependencies";
|
|
|
|
+ $python_virtual_environment/pip install --upgrade --no-cache-dir \
|
|
|
|
+ --no-deps davtelepot;
|
|
|
|
+ echo "Running python script";
|
|
|
|
+ $python_virtual_environment/python $python_script;
|
|
|
|
+ i=$?;
|
|
|
|
+done
|