setup_weber.py 686 B

123456789101112131415161718
  1. import sys
  2. import subprocess
  3. def start(args, logfile, errfile):
  4. try:
  5. subprocess.check_call("mix deps.get", cwd="WeberFramework", shell=True, stderr=errfile, stdout=logfile)
  6. subprocess.check_call("mix compile --all --force", cwd="WeberFramework", shell=True, stderr=errfile, stdout=logfile)
  7. subprocess.check_call("./start.sh", cwd="WeberFramework", shell=True, stderr=errfile, stdout=logfile)
  8. return 0
  9. except subprocess.CalledProcessError:
  10. return 1
  11. def stop(logfile, errfile):
  12. try:
  13. subprocess.check_call("killall beam", shell=True, cwd="/usr/bin")
  14. return 0
  15. except subprocess.CalledProcessError:
  16. return 1