deployer icon indicating copy to clipboard operation
deployer copied to clipboard

deploy:vendors task does not runs `composer install` (runs instead `php composer install`)

Open andrecolza opened this issue 3 years ago • 2 comments

  • Deployer version: 7.0.0 (but 7.0.0-rc.4 works)
  • Deployment OS: Ubuntu 22.04 / Ubuntu 20.04 on Plesk VPS

When excecuting deploy:vendors task, version 7.0.0 runs command cd ~/httpdocs/releases/22 && /var/www/vhosts/my-host/.phpenv/shims/php /var/www/vhosts/my-host/.phpenv/shims/composer install --verbose --prefer-dist --no-progress --no-interaction --no -dev --optimize-autoloader 2>&1 which does not run composer install, instead this command prints:

set -e
[ -n "$PHPENV_DEBUG" ] && set -x
program="${0##*/}"
if [ "$program" = "php" ]; then
  for arg; do
    case "$arg" in
    -e* | -- ) break ;;
    */* )
      if [ -f "$arg" ]; then
        export PHPENV_DIR="${arg%/*}"
        break
      fi
      ;;
    esac
  done
fi
export PHPENV_ROOT="/var/www/vhosts/my-host/.phpenv"
exec "/opt/plesk/phpenv/libexec/phpenv" exec "$program" "$@"

The only difference I found in recipe/deployer/vendors.php file between version 7.0.0 and version 7.0.0-rc.4 is:

Deployer v7.0.0-rc.4 recipe/deployer/vendors.php, lines 16-18
if (commandExist('composer')) {
    return which('composer');
}
Deployer v7.0.0 recipe/deployer/vendors.php, lines 16-18
if (commandExist('composer')) {
    return '{{bin/php}} ' . which('composer');
}

This second version causes the error, I suppose it needs to be revised in some circumstances (which I ignore 😅).

andrecolza avatar Jul 27 '22 16:07 andrecolza

Looks for me .phpenv does not use a official composer phar instead it wraps composer with some custom script 🤔. Which I personally would see as problamatic. Or can you identify if /var/www/vhosts/my-host/.phpenv/shims/composer is a phar or a custom script?

Normally composer file look something like this:

Bildschirmfoto 2022-07-27 um 19 45 28

Or something wrong with /var/www/vhosts/my-host/.phpenv/shims/php, what does /var/www/vhosts/my-host/.phpenv/shims/php --version return on your server?

alexander-schranz avatar Jul 27 '22 17:07 alexander-schranz

In fact composer is a custom script: immagine

/var/www/vhosts/my-host/.phpenv/shims/php --version works fine.

andrecolza avatar Jul 29 '22 07:07 andrecolza

Not sure what we should do about this one. Closing for cleaning purposes.

antonmedv avatar Sep 10 '22 06:09 antonmedv