Queer European MD passionate about IT

run_me.sh 847 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. # This file must be executable, otherwise the service cannot run it.
  3. # Run `$python_script` while exit code is 65.
  4. # At each iteration, pull news from repository and update dependencies.
  5. # Get current directory
  6. this_script_directory=$(cd `dirname $0` && pwd);
  7. cd "$this_script_directory";
  8. if [ ! -d "$this_script_directory/env" ]; then
  9. python3 -m venv env;
  10. env/bin/pip install -r requirements.txt;
  11. fi
  12. python_virtual_environment="$this_script_directory/env/bin"
  13. echo "Python script will be run while it exits with value===65.";
  14. i=65;
  15. while [ $i -eq 65 ]
  16. do
  17. echo "Pulling from repository..."
  18. git pull;
  19. echo "Updating dependencies";
  20. "$python_virtual_environment/pip" install --upgrade --no-cache-dir \
  21. --no-deps davtelepot;
  22. echo "Running python script";
  23. "$python_virtual_environment/python" -m bic_bot;
  24. i=$?;
  25. done