Saltstack Official PHP Formula
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

37 lines
1.1KB

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