Skip to content

Commit

Permalink
fix(composer): install v1 to keep using fxp/composer-asset-plugin
Browse files Browse the repository at this point in the history
fxpio/composer-asset-plugin#341 (comment)

> This plugin is only compatible with Composer 1. As indicated on the
> readme and the issue #334, the next major version of Composer Asset
> Plugin is so different, but also incompatible with the current version,
> that it became a new project named Foxy.

Installing from https://getcomposer.org/installer gets v2 (at the time
of this commit), which doesn't work with the `composer-asset-plugin`.
Installing from the available package still gets v1, at least on `bionic`.
Use this until Foxy can be evaluated.

Also update the test to check for `composer.json`, since the directory
is created, even with the plugin isn't installed properly (e.g. with v2).
  • Loading branch information
myii committed May 28, 2022
1 parent 9176541 commit f3f7350
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions salt/composer/init.sls
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
get-composer:
cmd.run:
- name: 'export COMPOSER_HOME=/usr/local/bin && 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
pkg.installed:
- name: composer

{% for user in pillar['composerusers'] %}
init-composer-{{user}}:
Expand All @@ -20,9 +11,9 @@ init-composer-{{user}}:
- shell: /bin/bash
- env:
- COMPOSER_HOME: '/www/{{user}}/.config/composer'
- unless: test -d /www/{{user}}/.config/composer
- unless: test -f /www/{{user}}/.config/composer/composer.json
- require:
- cmd: install-composer
- pkg: install-composer
discard-changes-{{user}}:
cmd.run:
- name: 'composer config --global discard-changes true'
Expand All @@ -32,5 +23,5 @@ discard-changes-{{user}}:
- env:
- COMPOSER_HOME: '/www/{{user}}/.config/composer'
- require:
- cmd: install-composer
- pkg: install-composer
{% endfor %}

0 comments on commit f3f7350

Please sign in to comment.