Saltstack Official PHP Formula
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

35 rindas
1.1KB

  1. {% from "php/map.jinja" import php with context %}
  2. {% set install_file = php.local_bin + '/composer' %}
  3. include:
  4. - php
  5. get-composer:
  6. cmd.run:
  7. - name: 'CURL=`which curl`; $CURL -sS https://getcomposer.org/installer | php'
  8. - unless: test -f {{ install_file }}
  9. - cwd: {{ php.temp_dir }}
  10. - require:
  11. - pkg: php
  12. # Get COMPOSER_DEV_WARNING_TIME from the installed composer, and if that time has passed
  13. # then it's time to run `composer selfupdate`
  14. #
  15. # It would be nice if composer had a command line switch to get this, but it doesn't,
  16. # and so we just grep for it.
  17. #
  18. update-composer:
  19. cmd.run:
  20. - name: "{{ install_file }} selfupdate"
  21. - unless: "WARNING_TIME=$(grep --text COMPOSER_DEV_WARNING_TIME {{ install_file }} | egrep '^\s*define' | sed -e 's,[^[:digit:]],,g'); php -r \"exit($WARNING_TIME > time() ? 0 : 1);\""
  22. - cwd: {{ php.temp_dir }}
  23. - require:
  24. - cmd: get-composer
  25. install-composer:
  26. cmd.wait:
  27. - name: install -m 0755 {{ php.temp_dir }}/composer.phar {{ install_file }}
  28. - cwd: {{ php.temp_dir }}
  29. - watch:
  30. - cmd: get-composer