start.sh 2.1 KB

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