Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing early return. #1696

Merged
merged 4 commits into from
Jun 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ 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:
# Corresponding value is defined in config.settings.php.
sync:
path: ${cm.core.path}/default
vcs:
path: ${cm.core.path}/default
path: ${cm.core.dirs.sync.path}
features:
no-overrides: true

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
6 changes: 3 additions & 3 deletions src/Robo/BltTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
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