diff --git a/CHANGELOG.md b/CHANGELOG.md index 082cebe..5ad191e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.0.0-RC11 - 2020-05-12 +- Updated various dependencies +- Fixed a bug when Craft expects `CRAFT_ENVIRONMENT` + ## 1.0.0-RC10 - 2020-02-19 - Craft 3.4 fix for new config/db.php structure - Exclude `assettransformindex` table from irgnoredTables diff --git a/README.md b/README.md index b048f7d..9f9c8cf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Craft Copy Plugin (RC10) +# Craft Copy Plugin (RC11) This little command line tool helps to speed up common tasks around Craft CMS deployment on [fortrabbit](https://www.fortrabbit.com/). Craft Copy syncs your local development environment with your fortrabbit App — up and down. It conveniently deploys deploys code changes and synchronizes latest images and database entries. This Craft CMS plugin will be installed locally and on the fortrabbit App. @@ -61,7 +61,7 @@ cd your/craft-project # Require Craft Copy via Composer composer config platform --unset -composer require fortrabbit/craft-copy:^1.0.0-RC10 +composer require fortrabbit/craft-copy:^1.0.0-RC11 # Install the plugin with Craft CMS php craft install/plugin copy diff --git a/bin/craft-copy-import-db.php b/bin/craft-copy-import-db.php index 44f8f0f..0e22635 100755 --- a/bin/craft-copy-import-db.php +++ b/bin/craft-copy-import-db.php @@ -28,6 +28,7 @@ // Bootstrap Craft /** @var \craft\console\Application $app */ +define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production'); $app = require $root . '/vendor/craftcms/cms/bootstrap/console.php'; if (count($argv) < 2 || stristr($argv[1], '.sql') == false) { diff --git a/composer.json b/composer.json index a3bac38..c417eb3 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "fortrabbit/craft-copy", "description": "Tooling for Craft on fortrabbit", "type": "craft-plugin", - "version": "1.0.0-RC10", + "version": "1.0.0-RC11", "keywords": [ "craft", "cms", @@ -24,12 +24,12 @@ "require": { "php": "^7.2.0", "albertofem/rsync-lib": "^1.0.0", - "cpliakas/git-wrapper": "^2.0", - "craftcms/cms": "^3.4.0-RC", + "cpliakas/git-wrapper": "^3.0", + "craftcms/cms": "^3.4.0", "ostark/yii2-artisan-bridge": "^1.2.0", - "symfony/process": "^4.2", + "symfony/process": "^4.2 | ^5.0", "vlucas/phpdotenv": "^2.5.1 | ^3.4.0", - "symfony/yaml": "^4.2", + "symfony/yaml": "^4.2 | ^5.0", "fortrabbit/craft-auto-migrate":"^2.0" }, "require-dev": { @@ -51,7 +51,7 @@ "changelogUrl": "https://raw.githubusercontent.com/fortrabbit/craft-copy/master/CHANGELOG.md" }, "scripts": { - "ps": "phpstan analyse src --level=6 -c phpstan.neon", + "ps": "phpstan analyse src --level=5 -c phpstan.neon", "php-cs-fixer": "php-cs-fixer fix", "csf": "@php-cs-fixer", "stan": "@ps", diff --git a/src/Actions/AllDownAction.php b/src/Actions/AllDownAction.php index f58f74d..f8a005d 100644 --- a/src/Actions/AllDownAction.php +++ b/src/Actions/AllDownAction.php @@ -30,17 +30,17 @@ public function run(string $config = null): int return ExitCode::UNSPECIFIED_ERROR; } - if (\Craft::$app->runAction('copy/db/down', ['interactive' => true, 'force' => true]) != 0) { + if (\Craft::$app->runAction('copy/db/down', ['interactive' => true]) !== 0) { $this->errorBlock('Failed to copy the database'); return ExitCode::UNSPECIFIED_ERROR; } - if (\Craft::$app->runAction('copy/assets/down', ['interactive' => true]) != 0) { + if (\Craft::$app->runAction('copy/assets/down', ['interactive' => true]) !== 0) { $this->errorBlock('Failed to copy the assets'); return ExitCode::UNSPECIFIED_ERROR; } - if (\Craft::$app->runAction('copy/code/down', ['interactive' => true]) != 0) { + if (\Craft::$app->runAction('copy/code/down', ['interactive' => true]) !== 0) { $this->errorBlock('Failed to copy the code'); return ExitCode::UNSPECIFIED_ERROR; } diff --git a/src/Actions/AllUpAction.php b/src/Actions/AllUpAction.php index 8f37346..2ff6131 100644 --- a/src/Actions/AllUpAction.php +++ b/src/Actions/AllUpAction.php @@ -30,17 +30,17 @@ public function run(string $config = null): int return ExitCode::UNSPECIFIED_ERROR; } - if (\Craft::$app->runAction('copy/db/up', ['interactive' => true, 'force' => true]) != 0) { + if (\Craft::$app->runAction('copy/db/up', ['interactive' => true, 'force' => true]) !== 0) { $this->errorBlock('Failed to copy the database'); return ExitCode::UNSPECIFIED_ERROR; } - if (\Craft::$app->runAction('copy/assets/up', ['interactive' => true]) != 0) { + if (\Craft::$app->runAction('copy/assets/up', ['interactive' => true]) !== 0) { $this->errorBlock('Failed to copy the assets'); return ExitCode::UNSPECIFIED_ERROR; } - if (\Craft::$app->runAction('copy/code/up', ['interactive' => true]) != 0) { + if (\Craft::$app->runAction('copy/code/up', ['interactive' => true]) !== 0) { $this->errorBlock('Failed to copy the code'); return ExitCode::UNSPECIFIED_ERROR; } diff --git a/src/Actions/CodeDownAction.php b/src/Actions/CodeDownAction.php index 2249558..cbbf727 100644 --- a/src/Actions/CodeDownAction.php +++ b/src/Actions/CodeDownAction.php @@ -2,7 +2,7 @@ namespace fortrabbit\Copy\Actions; -use GitWrapper\GitException; +use GitWrapper\Exception\GitException; use yii\console\ExitCode; /** diff --git a/src/Actions/CodeUpAction.php b/src/Actions/CodeUpAction.php index 8fe2d7a..e8c1400 100644 --- a/src/Actions/CodeUpAction.php +++ b/src/Actions/CodeUpAction.php @@ -3,7 +3,7 @@ namespace fortrabbit\Copy\Actions; use fortrabbit\Copy\Services\Git; -use GitWrapper\GitException; +use GitWrapper\Exception\GitException; use yii\console\ExitCode; /** diff --git a/src/Actions/SetupAction.php b/src/Actions/SetupAction.php index c574b52..87659cb 100644 --- a/src/Actions/SetupAction.php +++ b/src/Actions/SetupAction.php @@ -203,7 +203,7 @@ protected function setupRemote(DeployConfig $config) // Try to deploy code if ($this->confirm("The plugin is not installed with your App! Do you want to deploy now?", true)) { $this->cmdBlock('copy/code/up'); - if (Craft::$app->runAction('copy/code/up', ['interactive' => $this->interactive]) != 0) { + if (Craft::$app->runAction('copy/code/up', ['interactive' => $this->interactive]) !== 0) { // failed return false; } @@ -215,7 +215,7 @@ protected function setupRemote(DeployConfig $config) // Push DB $this->cmdBlock('php craft copy/db/up'); - if (Craft::$app->runAction('copy/db/up', ['interactive' => true, 'force' => true]) != 0) { + if (Craft::$app->runAction('copy/db/up', ['interactive' => true, 'force' => true]) !== 0) { return false; } diff --git a/src/Services/Git.php b/src/Services/Git.php index f894750..b069c50 100644 --- a/src/Services/Git.php +++ b/src/Services/Git.php @@ -3,7 +3,7 @@ namespace fortrabbit\Copy\Services; use fortrabbit\Copy\Plugin; -use GitWrapper\GitException; +use GitWrapper\Exception\GitException; use GitWrapper\GitWorkingCopy; use GitWrapper\GitWrapper;