Saltstack Official PHP Formula
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

35 lines
1.0KB

  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. install-composer:
  13. cmd.wait:
  14. - name: mv {{ php.temp_dir }}/composer.phar {{ install_file }}
  15. - cwd: {{ php.temp_dir }}
  16. - watch:
  17. - cmd: get-composer
  18. # Get COMPOSER_DEV_WARNING_TIME from the installed composer, and if that time has passed
  19. # then it's time to run `composer selfupdate`
  20. #
  21. # It would be nice if composer had a command line switch to get this, but it doesn't,
  22. # and so we just grep for it.
  23. #
  24. update-composer:
  25. cmd.run:
  26. - name: "{{ install_file }} selfupdate"
  27. - unless: test $(grep --text COMPOSER_DEV_WARNING_TIME {{ install_file }} | egrep '^\s*define' | sed -e 's,[^[:digit:]],,g') \> $(php -r 'echo time();')
  28. - cwd: {{ php.temp_dir }}
  29. - require:
  30. - cmd: install-composer