Advertisement
Guest User

Untitled

a guest
Jan 11th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. # We set up projects based on what is set up in the pillar data
  2. # find settings in pillar/projects.sls
  3.  
  4. {% for project, project_arg in pillar.get('projects',{}).items() %}
  5. load-project-{{ project }}:
  6. git.latest:
  7. - name: {{ project_arg['name'] }}
  8. - target: /var/www/{{ project_arg['target'] }}
  9. - unless: cd /var/www/{{ project_arg['target'] }}/provision/salt/config
  10. {% if project_arg['rev'] is defined and project_arg['rev'] != '' %}- rev: {{ project_arg['rev'] }}{%- endif %}
  11. {% if project_arg['remote_name'] is defined and project_arg['remote_name'] != '' %}- remote_name: {{ project_arg['remote_name'] }}{%- endif %}
  12. {% if project_arg.get( 'force', False ) is sameas True %}- force: True{%- endif %}
  13. {% if project_arg.get( 'submodules', False ) is sameas True %}- submodules: True{%- endif %}
  14. {% if project_arg.get( 'force_checkout', False ) is sameas True %}- force_checkout: True{%- endif %}
  15. {% if project_arg.get( 'mirror', False ) is sameas True %}- mirror: True{%- endif %}
  16. {% if project_arg.get( 'bare', False ) is sameas True %}- bare: True{%- endif %}
  17. {% if project_arg['identity'] is defined and project_arg['identity'] != '' %}- identity: {{ project_arg['identity'] }}{%- endif %}
  18. {% if project_arg['user'] is defined and project_arg['user'] != '' %}- user: {{ project_arg['user'] }}{%- endif %}
  19. {% endfor %}
  20.  
  21.  
  22.  
  23. #{% for project, project_arg in pillar.get('projects',{}).items() %}
  24. #project-install-{{ project }}:
  25. # cwd.run:
  26. # - name: /var/www/{{ project_arg['name'] }}
  27. # - target: /var/www/{{ project_arg['target'] }}
  28. # - unless: cd /var/www/{{ project_arg['target'] }}/provision/salt/config
  29. #{% endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement