These states manage the installed packages for composer for PHP. Note that either composer is installed and accessible via a bin directory or you can pass the location of composer in the state.
get-composer:
cmd.run:
- name: 'CURL=`which curl`; $CURL -sS https://getcomposer.org/installer | php'
- unless: test -f /usr/local/bin/composer
- cwd: /root/
install-composer:
cmd.wait:
- name: mv /root/composer.phar /usr/local/bin/composer
- cwd: /root/
- watch:
- cmd: get-composer
/path/to/project:
composer.installed:
- no_dev: true
- require:
- cmd: install-composer
# Without composer installed in your PATH
# Note: composer.phar must be executable for state to work properly
/path/to/project:
composer.installed:
- composer: /path/to/composer.phar
- php: /usr/local/bin/php
- no_dev: true
Verify that composer has installed the latest packages give a composer.json and composer.lock file in a directory.
Which system user to run composer as.
Deprecated since version 2014.1.4.
Which system user to run composer as.
New in version 2014.1.4.
Docs for previous releases are available on salt.rtfd.org.
Latest Salt release: 2014.7.2
Upcoming SaltStack events, webinars and local meet ups and user groups.