diff --git a/composer.json b/composer.json index 68c4039..ff2158c 100644 --- a/composer.json +++ b/composer.json @@ -1,29 +1,30 @@ { - "name": "easycorp/easy-deploy-bundle", + "name": "reconnect/easy-deploy-bundle", "type": "symfony-bundle", "description": "The easiest way to deploy Symfony applications", "keywords": ["deploy", "deployment", "deployer"], - "homepage": "https://github.com/EasyCorp/easy-deploy-bundle", + "homepage": "https://github.com/reconnect/easy-deploy-bundle", "license": "MIT", "authors": [ { - "name": "Javier Eguiluz", - "email": "javiereguiluz@gmail.com" + "name": "Thibaut Cheymol", + "email": "thibaut.cheymol@gmail.com" } ], "require": { "php": ">=7.2.0", - "symfony/console": "~2.3|~3.0|~4.0|~5.0", - "symfony/dependency-injection": "~2.3|~3.0|~4.0|~5.0", - "symfony/expression-language": "~2.4|~3.0|~4.0|~5.0", - "symfony/filesystem": "~2.3|~3.0|~4.0|~5.0", - "symfony/http-foundation": "~2.3|~3.0|~4.0|~5.0", - "symfony/http-kernel": "~2.3|~3.0|~4.0|~5.0", + "symfony/config": "~5.0|~6.0|~7.0", + "symfony/console": "~5.0|~6.0|~7.0", + "symfony/dependency-injection": "~5.0|~6.0|~7.0", + "symfony/expression-language": "~5.0|~6.0|~7.0", + "symfony/filesystem": "~5.0|~6.0|~7.0", + "symfony/http-foundation": "~5.0|~6.0|~7.0", + "symfony/http-kernel": "~5.0|~6.0|~7.0", "symfony/polyfill-mbstring": "^1.3", - "symfony/process": "~2.3|~3.0|~4.0|~5.0" + "symfony/process": "~5.0|~6.0|~7.0" }, "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "9.5.*" }, "config": { "sort-packages": true diff --git a/src/Command/DeployCommand.php b/src/Command/DeployCommand.php index a3c6a5c..eb0f3d6 100644 --- a/src/Command/DeployCommand.php +++ b/src/Command/DeployCommand.php @@ -38,7 +38,7 @@ public function __construct(FileLocator $fileLocator, string $projectDir, string parent::__construct(); } - protected function configure() + protected function configure(): void { $this ->setName('deploy') @@ -50,7 +50,7 @@ protected function configure() ; } - protected function initialize(InputInterface $input, OutputInterface $output) + protected function initialize(InputInterface $input, OutputInterface $output): void { $customConfigPath = $input->getOption('configuration'); if (null !== $customConfigPath && !is_readable($customConfigPath)) { @@ -58,18 +58,22 @@ protected function initialize(InputInterface $input, OutputInterface $output) } if (null !== $customConfigPath && is_readable($customConfigPath)) { - return $this->configFilePath = $customConfigPath; + $this->configFilePath = $customConfigPath; + + return; } $defaultConfigPath = SymfonyConfigPathGuesser::guess($this->projectDir, $input->getArgument('stage')); if (is_readable($defaultConfigPath)) { - return $this->configFilePath = $defaultConfigPath; + $this->configFilePath = $defaultConfigPath; + + return; } $this->createDefaultConfigFile($input, $output, $defaultConfigPath, $input->getArgument('stage')); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $logFilePath = sprintf('%s/deploy_%s.log', $this->logDir, $input->getArgument('stage')); $context = new Context($input, $output, $this->projectDir, $logFilePath, true === $input->getOption('dry-run'), $output->isVerbose()); diff --git a/src/Command/RollbackCommand.php b/src/Command/RollbackCommand.php index 817905d..c233615 100644 --- a/src/Command/RollbackCommand.php +++ b/src/Command/RollbackCommand.php @@ -33,7 +33,7 @@ public function __construct(string $projectDir, string $logDir) parent::__construct(); } - protected function configure() + protected function configure(): void { $this ->setName('rollback') @@ -45,7 +45,7 @@ protected function configure() ; } - protected function initialize(InputInterface $input, OutputInterface $output) + protected function initialize(InputInterface $input, OutputInterface $output): void { $customConfigPath = $input->getOption('configuration'); if (null !== $customConfigPath && !is_readable($customConfigPath)) { @@ -53,18 +53,22 @@ protected function initialize(InputInterface $input, OutputInterface $output) } if (null !== $customConfigPath && is_readable($customConfigPath)) { - return $this->configFilePath = $customConfigPath; + $this->configFilePath = $customConfigPath; + + return; } $defaultConfigPath = SymfonyConfigPathGuesser::guess($this->projectDir, $input->getArgument('stage')); if (is_readable($defaultConfigPath)) { - return $this->configFilePath = $defaultConfigPath; + $this->configFilePath = $defaultConfigPath; + + return; } throw new \RuntimeException(sprintf("The default configuration file does not exist or it's not readable, and no custom configuration file was given either. Create the '%s' configuration file and run this command again.", $defaultConfigPath)); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $logFilePath = sprintf('%s/deploy_%s.log', $this->logDir, $input->getArgument('stage')); $context = new Context($input, $output, $this->projectDir, $logFilePath, true === $input->getOption('dry-run'), $output->isVerbose()); diff --git a/src/DependencyInjection/EasyDeployExtension.php b/src/DependencyInjection/EasyDeployExtension.php index 8c08e18..b52aa84 100644 --- a/src/DependencyInjection/EasyDeployExtension.php +++ b/src/DependencyInjection/EasyDeployExtension.php @@ -18,7 +18,7 @@ class EasyDeployExtension extends Extension { - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.xml'); diff --git a/src/Deployer/DefaultDeployer.php b/src/Deployer/DefaultDeployer.php index fa28adc..419d46f 100644 --- a/src/Deployer/DefaultDeployer.php +++ b/src/Deployer/DefaultDeployer.php @@ -224,6 +224,8 @@ private function findConsoleBinaryPath(Server $server): string if (null === $server->get(Property::console_bin)) { throw new InvalidConfigurationException(sprintf('The "console" binary of your Symfony application is not available in any of the following directories: %s. Configure the "binDir" option and set it to the directory that contains the "console" binary.', implode(', ', $symfonyConsoleBinaries))); } + + return $server->resolveProperties('{{ project_dir }}/bin/console'); } private function createRemoteDirectoryLayout(): void @@ -261,7 +263,8 @@ private function doUpdateCode(): void $this->runRemote(sprintf('if [ -d {{ deploy_dir }}/repo ]; then cd {{ deploy_dir }}/repo && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard %s && git clean -q -d -x -f; else git clone -q -b %s %s {{ deploy_dir }}/repo && cd {{ deploy_dir }}/repo && git checkout -q -b deploy %s; fi', $repositoryRevision, $this->getConfig(Option::repositoryBranch), $this->getConfig(Option::repositoryUrl), $repositoryRevision)); $this->log('