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

Provide a way to setDefaultConfiguration programmatically

Open YetiCGN opened this issue 7 years ago • 1 comments

I've noticed in src/Configuration/DefaultConfiguration.php that the code assumes a lot of configuration defaults depending on the Symfony version used. So for 3.4 and up it already assumes the Symfony 4 directory structure. But it's entirely possible to run a project on Symfony 3.4 LTS and even 4.1 and still use the "old" layout.

Please provide an easy way to select either of the three configuration presets to save a couple of lines to set everything back to what's actually used.

The magic here made it a bit difficult to determine why our deployment was failing for a Symfony 3.4 project. You could also check your assumptions against the "extra" section in the composer.json, where some of the directories are configured.

Current code:

            ->configDir('app/config')
            ->logDir('var/logs')
            ->templatesDir('app/Resources/views')
            ->webDir('web')
            ->sharedFilesAndDirs(['app/config/parameters.yml', 'var/logs'])
            ->writableDirs(['var/cache/', 'var/logs/'])
            ->controllersToRemove(['web/app_*.php'])

Should be more like:

            ->directoryStructure(DefaultDeployer::SYMFONY_3)

YetiCGN avatar Jul 02 '18 10:07 YetiCGN

@YetiCGN great job !

I reference your PR

jbourdic avatar Aug 09 '18 14:08 jbourdic