Skip to content

Commit

Permalink
Fixing early return. (#1696)
Browse files Browse the repository at this point in the history
* Fixes #1675: Setting cm.core.dirs.vcs to cm.core.dirs.sync.

* Fixing early return.

* Adding a warning.

* Change value of cm.core.deploy-key on travis.
  • Loading branch information
grasmash authored Jun 19, 2017
1 parent ba56e84 commit e54f90b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions scripts/blt/ci/internal/create_blt_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/Robo/Commands/Deploy/DeployCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', '');

Expand Down
5 changes: 3 additions & 2 deletions src/Robo/Commands/Setup/ConfigCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit e54f90b

Please sign in to comment.