EasyCorp / easy-deploy-bundle

The easiest way to deploy your Symfony applications
https://easycorp.io/EasyDeploy
MIT License
471 stars 103 forks source link

Composer install error when deploying (symfony export environment missing) #84

Open malandles opened 5 years ago

malandles commented 5 years ago

Configuration

Problem

When running the deploy command, while in the "Preparing app" phase, I get the following error:

The command "ssh -A staging '(export APP_ENV=prod; cd /var/www/html/releases/20181129155451 && /usr/local/bin/composer install --no-dev --prefer-dist --no-interaction --quiet)'" failed.  

  Exit Code: 1(General error)

Which if I run the command on my remote server without the --quiet option gives this error:

An error occurred when executing the "'cache:clear --no-warmup'" command:                                                                                                                                
  PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "SensioGeneratorBundle" from namespace "Sensio\Bundle\GeneratorBundle".                     
  Did you forget a "use" statement for another namespace? in /var/www/html/app/AppKernel.php:43

Solution

This error does not happen if you specify the symfony environment before doing the composer install.

export SYMFONY_ENV=prod

I will try to do a pull-request as soon as I can.

gustawdaniel commented 5 years ago

But how to disable quiet flag? I have --quiet even if I run verbose mode ./bin/console deploy staging -v

gustawdaniel commented 5 years ago

I found:

https://github.com/EasyCorp/easy-deploy-bundle/blob/master/doc/default-deployer.md

->composerInstallFlags('--no-dev --prefer-dist --no-interaction') // default have also  --quiet