easy-deploy-bundle icon indicating copy to clipboard operation
easy-deploy-bundle copied to clipboard

Symfony 5 compatibility

Open AcerxX opened this issue 4 years ago • 8 comments

Hello,

When trying to update the app to symfony 5 I get the following dependency error:

Problem 1 - Conclusion: don't install symfony/console v5.0.0 - Conclusion: don't install symfony/console v5.0.0-RC1 - Conclusion: don't install symfony/console v5.0.0-BETA2 - Installation request for easycorp/easy-deploy-bundle dev-master -> satisfiable by easycorp/easy-deploy-bundle[dev-master]. - Conclusion: don't install symfony/console v5.0.0-BETA1 - Conclusion: don't install symfony/console 5.1.x-dev - easycorp/easy-deploy-bundle dev-master requires symfony/console ~2.3|~3.0|~4.0 -> satisfiable by symfony/console[2.3.x-dev, 2.4.x-dev, 2.5.x-dev, 2.6.x-dev, 2.7.x-dev, 2.8.x-dev, 3.0.x-dev, 3.1.x-dev, 3.2.x-dev, 3.3.x-dev, 3.4.x-dev, 4.0.x-dev, 4.1.x-dev, 4.2.x-dev, 4.3.x-dev, 4.4.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 3.4.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 4.3.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 4.4.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 2.3.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 2.4.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 2.5.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 2.6.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 2.7.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 2.8.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 3.0.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 3.1.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 3.2.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 3.3.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 4.0.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 4.1.x-dev]. - Can only install one of: symfony/console[5.0.x-dev, 4.2.x-dev]. - Installation request for symfony/console 5.* -> satisfiable by symfony/console[5.0.x-dev, 5.1.x-dev, v5.0.0, v5.0.0-BETA1, v5.0.0-BETA2, v5.0.0-RC1].

Thanks.

AcerxX avatar Nov 27 '19 07:11 AcerxX

Looks like this should be resolved once https://github.com/EasyCorp/easy-deploy-bundle/pull/103 is merged.

daum avatar Jan 20 '20 14:01 daum

Hello, a new tag 1.0.6 has been released, can you test and close this ticket if it's OK.

COil avatar Jan 30 '20 10:01 COil

I deployed with success an sf5 app on prod today

It took me time and some internet digging & code digging, but it works finally


here is my deploy file, if it can help:

<?php

use EasyCorp\Bundle\EasyDeployBundle\Configuration\Option;
use EasyCorp\Bundle\EasyDeployBundle\Deployer\DefaultDeployer;

return new class extends DefaultDeployer
{
    public function configure()
    {
        return $this->getConfigBuilder()
            // uses my internal SSH config ~/.ssh/config file
            ->server('my-server-ssh-config')
            ->deployDir('/var/www/my-website')
            ->repositoryUrl('[email protected]:user/repo.git')
            ->repositoryBranch('master')
            ->useSshAgentForwarding(false) // SSH key exists on production server
            ->keepReleases(3)
            ->sharedFilesAndDirs(['.env', '.env.local', 'var/log', 'public/uploads'])
            ->writableDirs(['var/cache/', 'var/log/', 'public/uploads/'])
            ->dumpAsseticAssets(false) // usage of Yarn instead
        ;
    }

    public function beforeStartingDeploy()
    {
        $this->log('Local checks');
        $this->runLocal('make lint'); // run locally some linters via the Makefile
    }

    public function beforePublishing()
    {
        $this->log('Remote yarn');
        $this->runRemote('yarn install');
        $this->runRemote('yarn run build');

        $this->log('Remote composer dump env prod');
        $this->runRemote(sprintf('%s dump-env prod', $this->getConfig(Option::remoteComposerBinaryPath)));

        $this->log('Remote migration');
        $this->runRemote('{{ console_bin }} doctrine:migration:migrate --no-interaction --allow-no-migration');

        $this->log('Remote cache clear');
        $this->runRemote('{{ console_bin }} cache:clear');
    }

    public function beforeFinishingDeploy()
    {
        $this->log('Remote Restarting servers');
        $this->runRemote('/etc/init.d/nginx restart');
        $this->runRemote('/etc/init.d/php7.4-fpm restart');
    }
};

ℹ️ before the first deploy to work, i had to:

  • make a first deploy, it initialises the /releases and /shared folders on prod server
  • manually copy the .env and a production ready filled .env.local file in the /shared folder
  • then launch a final deploy -v and it works :)

Cheers

94noni avatar Apr 16 '20 15:04 94noni

Looking forward to official Symfony 5 support!

maathieu avatar Apr 23 '20 06:04 maathieu

What do you mean?

COil avatar Apr 23 '20 07:04 COil

Currently in the documentation Symfony 5 is not listed as compatible:

"Your application: it can use any version of Symfony (2.7+, 3.x, 4.x)."

maathieu avatar Apr 28 '20 12:04 maathieu

But it is, I am using it with Symfony 5 already on multiples projects. May be, it's the doc that isn't correct. Feel free to submit a PR please. :)

COil avatar Apr 28 '20 13:04 COil

@maathieu cc @COil PR opened (with my pro github account)

maybe this issue can be closed after :)

noniagriconomie avatar Apr 29 '20 10:04 noniagriconomie