From 5ead5f3f5cae05c4197b0e3070f4be4830ba670e Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Mon, 19 Jun 2017 14:56:45 -0400 Subject: [PATCH 1/4] Fixes #1675: Setting cm.core.dirs.vcs to cm.core.dirs.sync. --- config/build.yml | 2 +- src/Robo/BltTasks.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/build.yml b/config/build.yml index efa3bd5ed..3a46aa90f 100644 --- a/config/build.yml +++ b/config/build.yml @@ -51,7 +51,7 @@ cm: sync: path: ${cm.core.path}/default vcs: - path: ${cm.core.path}/default + path: ${cm.core.dirs.sync.path} features: no-overrides: true diff --git a/src/Robo/BltTasks.php b/src/Robo/BltTasks.php index ca98dc7b9..3e62dc482 100644 --- a/src/Robo/BltTasks.php +++ b/src/Robo/BltTasks.php @@ -89,9 +89,9 @@ protected function invokeCommand($command_name, array $args = []) { $exit_code = $application->runCommand($command, $input, $this->output()); $this->invokeDepth--; - // The application will catch any exceptions thrown in the run command. - // We must check the exit code and throw our own exception. This allows - // us to do without checking the exit code of every invoked command. + // The application will catch any exceptions thrown in the executed + // command. We must check the exit code and throw our own exception. This + // obviates the need to check the exit code of every invoked command. if ($exit_code) { throw new BltException("Command `$command_name {$input->__toString()}` exited with code $exit_code."); } From 99ba0ab27be65d14757c0e9c874b4505ec841db2 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Mon, 19 Jun 2017 15:19:31 -0400 Subject: [PATCH 2/4] Fixing early return. --- src/Robo/Commands/Setup/ConfigCommand.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Robo/Commands/Setup/ConfigCommand.php b/src/Robo/Commands/Setup/ConfigCommand.php index ca2dbb28e..a9c97b1f2 100644 --- a/src/Robo/Commands/Setup/ConfigCommand.php +++ b/src/Robo/Commands/Setup/ConfigCommand.php @@ -36,11 +36,12 @@ public function import() { // required config is exported. if (in_array($strategy, ['core-only', 'config-split'])) { $core_config_file = $this->getConfigValue('docroot') . '/' . $this->getConfigValue("cm.core.dirs.$cm_core_key.path") . '/core.extension.yml'; + if (!file_exists($core_config_file)) { $this->logger->warning("BLT will NOT import configuration, $core_config_file was not found."); + // This is not considered a failure. + return 0; } - // This is not considered a failure. - return 0; } $task = $this->taskDrush() From 7acaf7af4e762930a04579bc2551356ce056d391 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Mon, 19 Jun 2017 15:33:42 -0400 Subject: [PATCH 3/4] Adding a warning. --- config/build.yml | 1 + src/Robo/Commands/Deploy/DeployCommand.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/config/build.yml b/config/build.yml index 3a46aa90f..b8e2265bd 100644 --- a/config/build.yml +++ b/config/build.yml @@ -44,6 +44,7 @@ cm: key: sync # A different config key is used by the deploy:update step, which is executed on Acquia Cloud. # This must also have a corresponding value at cm.core.dirs.vcs. + # If you are NOT on Acquia hosting, you probably need to change this to 'sync'. # @see https://github.com/acquia/blt/issues/678 deploy-key: vcs dirs: diff --git a/src/Robo/Commands/Deploy/DeployCommand.php b/src/Robo/Commands/Deploy/DeployCommand.php index 97d884bf7..7edc30681 100644 --- a/src/Robo/Commands/Deploy/DeployCommand.php +++ b/src/Robo/Commands/Deploy/DeployCommand.php @@ -560,7 +560,11 @@ public function updateSites() { // /config/default. ACE internally sets the vcs configuration // directory to /config/default, so we use that. // @see https://github.com/acquia/blt/issues/678 + if (!isset($_ENV['AH_SITE_ENVIRONMENT']) && $this->getConfigValue('cm.core.deploy-key') == 'vcs') { + $this->logger->warning('cm.core.deploy-key is set to "vcs". This will only work on Acquia Cloud. If you are not using Acquia Cloud, change this configuration value.'); + } $this->config->set('cm.core.key', $this->getConfigValue('cm.core.deploy-key')); + // Disable alias since we are targeting specific uri. $this->config->set('drush.alias', ''); From c3c8e77916bc9546a8785a206e622979f7c06a21 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Mon, 19 Jun 2017 15:35:31 -0400 Subject: [PATCH 4/4] Change value of cm.core.deploy-key on travis. --- scripts/blt/ci/internal/create_blt_project.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/blt/ci/internal/create_blt_project.sh b/scripts/blt/ci/internal/create_blt_project.sh index 2ece82558..4db9aa71a 100755 --- a/scripts/blt/ci/internal/create_blt_project.sh +++ b/scripts/blt/ci/internal/create_blt_project.sh @@ -27,6 +27,9 @@ yaml-cli update:value blt/project.yml project.local.hostname '127.0.0.1:8888' # Define BLT's deployment endpoints. yaml-cli update:value blt/project.yml git.remotes.0 bolt8@svn-5223.devcloud.hosting.acquia.com:bolt8.git yaml-cli update:value blt/project.yml git.remotes.1 git@github.com:acquia-pso/blted8.git +# Set cm.core.deploy-key to sync since we are not executing this on Acquia Cloud. +touch blt/project.local.yml +yaml-cli update:value blt/project.local.yml cm.core.deploy-key sync git add -A git commit -m 'Adding new dependencies from BLT update.' -n