1
0

start.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. set -e
  3. service_list="$*"
  4. echo "service list: $service_list"
  5. metasrht-initdb
  6. /usr/bin/gunicorn metasrht.app:app -c /etc/sr.ht/meta.sr.ht.gunicorn.conf.py -b 0.0.0.0:5000 -D
  7. /usr/bin/metasrht-api -b 0.0.0.0:5100 &
  8. /usr/bin/celery -A metasrht.webhooks worker --loglevel=info &
  9. echo "0 2 * * * /usr/bin/metasrht-daily" >>/etc/crontab
  10. if [[ "$service_list" == *"git"* ]]; then
  11. gitsrht-initdb
  12. /usr/bin/gunicorn gitsrht.app:app -b 0.0.0.0:5001 -c /etc/sr.ht/git.sr.ht.gunicorn.conf.py -D
  13. /usr/bin/gitsrht-api -b 0.0.0.0:5101 &
  14. /usr/bin/celery -A gitsrht.webhooks worker --loglevel=info &
  15. echo "*/20 * * * * /usr/bin/gitsrht-periodic" >>/etc/crontab
  16. fi
  17. if [[ "$service_list" == *"hg"* ]]; then
  18. hgsrht-initdb
  19. /usr/bin/gunicorn hgsrht.app:app -b 0.0.0.0:5010 -c /etc/sr.ht/git.sr.ht.gunicorn.conf.py -D
  20. /usr/bin/hgsrht-api -b 0.0.0.0:5110 &
  21. /usr/bin/celery -A hgsrht.webhooks worker --loglevel=info &
  22. echo "*/20 * * * * /usr/bin/hgsrht-periodic" >>/etc/crontab
  23. fi
  24. if [[ "$service_list" == *"builds"* ]]; then
  25. buildsrht-initdb
  26. /usr/bin/gunicorn buildsrht.app:app -b 0.0.0.0:5002 -c /etc/sr.ht/builds.sr.ht.gunicorn.conf.py -D
  27. fi
  28. #if [[ "$service_list" == *"lists"* ]]; then
  29. # listssrht-initdb
  30. # /usr/bin/gunicorn listssrht.app:app -b 0.0.0.0:5006 -c /etc/sr.ht/lists.sr.ht.gunicorn.conf.py -D
  31. # /usr/bin/listssrht-api -b 0.0.0.0:5106 &
  32. # /usr/bin/listssrht-lmtp &
  33. # /usr/bin/celery -A listssrht.webhooks worker --loglevel=info &
  34. #
  35. #fi
  36. if [[ "$service_list" == *"man"* ]]; then
  37. mansrht-initdb
  38. /usr/bin/gunicorn mansrht.app:app -b 0.0.0.0:5004 -c /etc/sr.ht/man.sr.ht.gunicorn.conf.py -D
  39. fi
  40. if [[ "$service_list" == *"todo"* ]]; then
  41. todosrht-initdb
  42. /usr/bin/gunicorn todosrht.app:app -b 0.0.0.0:5003 -c /etc/sr.ht/todo.sr.ht.gunicorn.conf.py -D
  43. /usr/bin/todosrht-api -b 0.0.0.0:5103
  44. # /usr/bin/todosrht-lmtp &
  45. /usr/bin/celery -A todosrht.webhooks worker --loglevel=info &
  46. fi
  47. if [[ "$service_list" == *"paste"* ]]; then
  48. pastesrht-initdb
  49. /usr/bin/gunicorn pastesrht.app:app -b 0.0.0.0:5011 -c /etc/sr.ht/paste.sr.ht.gunicorn.conf.py -D
  50. fi
  51. tail -f /dev/null