Ei kuvausta

init.sls 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. {% import 'globals.jinja' as globals %}
  2. {% import 'circusd/lib.jinja' as circusd %}
  3. {% set settings = pillar['clients']['andrew']['xword'] %}
  4. include:
  5. - clients.andrew
  6. - generic_packages.python3_6
  7. - generic_packages.libsm6
  8. - generic_packages.libxrender1
  9. /etc/nginx/sites-enabled/xword:
  10. file.managed:
  11. - source: salt://clients/andrew/xword/files/xword.nginx
  12. - template: jinja
  13. - context:
  14. settings: {{ settings }}
  15. - require:
  16. - file: nginx_conf
  17. - watch_in:
  18. - service: nginx
  19. /data/clients/andrew/xword:
  20. file.directory:
  21. - require:
  22. - file: /data/clients/andrew
  23. /data/clients/andrew/xword/static:
  24. file.directory:
  25. - require:
  26. - file: /data/clients/andrew/xword
  27. - git: xword
  28. xword:
  29. git.latest:
  30. - name: git@git.codefans.co.za:andrew/xword.git
  31. - target: /data/clients/andrew/xword
  32. - rev: {{ settings.rev }}
  33. - identity: {{ globals.config.git.identity_file }}
  34. - require:
  35. - file: /data/clients/andrew/xword
  36. {{ circusd.circusd_watcher_running() }}
  37. {{ circusd.circusd_watcher_configuration(
  38. 'xword',
  39. 'salt://clients/andrew/xword/files/xword.ini',
  40. {'settings': settings},
  41. [],
  42. [
  43. 'git: xword',
  44. 'file: xword_config',
  45. 'virtualenv: /data/virtualenvs/xword',
  46. ]
  47. ) }}
  48. /data/virtualenvs/xword:
  49. virtualenv.managed:
  50. - python: /usr/bin/python3.6
  51. - requirements: /data/clients/andrew/xword/requirements.txt
  52. - require:
  53. - pkg: python3_6
  54. - file: /data/virtualenvs
  55. - git: xword
  56. xword_config:
  57. file.managed:
  58. - name: /data/clients/andrew/xword/xword/settings_local.py
  59. - source: salt://clients/andrew/xword/files/settings_local.py
  60. - template: jinja
  61. - require:
  62. - git: xword
  63. xword_collectstatic:
  64. cmd.run:
  65. - name: /data/virtualenvs/xword/bin/python3 /data/clients/andrew/xword/manage.py collectstatic --noinput --verbosity 0 --clear --link
  66. - require:
  67. - file: /data/clients/andrew/xword/static
  68. - onchanges:
  69. - virtualenv: /data/virtualenvs/xword
  70. - git: xword
  71. - file: xword_config