diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 2782e208f..884ab00c5 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -19,7 +19,7 @@ For major releases, coordinate with ORCA prior to starting this process to ensur ## Review issue labels -Review the issues and pull requests that will make up the release and ensure they are labelled correctly so that the changelog and release notes will be generated with the correct categories (new features, bug fixes, etc...). +Review the issues and pull requests that will make up the release and ensure they are labelled correctly so that the changelog and release notes will be generated with the correct categories (new features, bug fixes, etc...). [Github releases](https://github.com/acquia/blt/releases) have a link to display all commits since a given release. ## Test via Canary diff --git a/src/Robo/Commands/Source/LinkPackageCommand.php b/src/Robo/Commands/Source/LinkPackageCommand.php index f9156f7cd..704bdb669 100644 --- a/src/Robo/Commands/Source/LinkPackageCommand.php +++ b/src/Robo/Commands/Source/LinkPackageCommand.php @@ -37,7 +37,7 @@ class LinkPackageCommand extends BltTasks { */ public function linkComposer(array $options = [ 'name' => 'acquia/blt', - 'path' => '../../packages/blt', + 'path' => '../../src/blt', 'version-constraint' => '*', ]) { $path_parts = explode('/', $options['path']); diff --git a/src/Robo/Commands/Source/SettingsCommand.php b/src/Robo/Commands/Source/SettingsCommand.php index 06915f968..5793f6835 100644 --- a/src/Robo/Commands/Source/SettingsCommand.php +++ b/src/Robo/Commands/Source/SettingsCommand.php @@ -62,8 +62,11 @@ public function initialize() { * @command source:build:settings * * @aliases blt:init:settings bis settings setup:settings + * @throws \Acquia\Blt\Robo\Exceptions\BltException */ public function generateSiteConfigFiles() { + $this->generateLocalConfigFile(); + // Generate hash file in salt.txt. $this->hashSalt(); @@ -348,4 +351,40 @@ public function createDeployId($options = ['id' => InputOption::VALUE_REQUIRED]) } } + /** + * Generates local.blt.yml from example.local.blt.yml. + * + * @throws \Acquia\Blt\Robo\Exceptions\BltException + */ + private function generateLocalConfigFile() { + $localConfigFile = $this->getConfigValue('blt.config-files.local'); + $exampleLocalConfigFile = $this->getConfigValue('blt.config-files.example-local'); + $localConfigFilepath = $this->getInspector() + ->getFs() + ->makePathRelative($localConfigFile, $this->getConfigValue('repo.root')); + $exampleLocalConfigFilepath = $this->getInspector() + ->getFs() + ->makePathRelative($exampleLocalConfigFile, $this->getConfigValue('repo.root')); + + if (file_exists($localConfigFile)) { + // Don't overwrite an existing local.blt.yml. + return; + } + + if (!file_exists($exampleLocalConfigFile)) { + $this->say("Could not find $exampleLocalConfigFilepath. Create and commit this file if you'd like to automatically generate $localConfigFilepath based on this template."); + return; + } + + $result = $this->taskFilesystemStack() + ->copy($exampleLocalConfigFile, $localConfigFile) + ->stopOnFail() + ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE) + ->run(); + + if (!$result->wasSuccessful()) { + throw new BltException("Unable to create $localConfigFilepath."); + } + } + }