Skip to content

Commit

Permalink
Fixes acquia#4397 to create the ci.blt.yml file by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemadison13 authored and Mike Madison committed May 5, 2022
1 parent b4dece2 commit bf8f785
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Robo/Commands/Blt/UpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,13 @@ public function initialize() {
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
public function addToProject() {
// Initializes the project template / scaffold.
$this->initializeBlt();
// Creates the blt/blt.yml file.
$this->setProjectName();
// Places the blt/ci.blt.yml file.
$this->createCiConfig();
// Adds default BLT values into the project .gitignore file.
$this->initGitignore();
// Invoke command instead of calling method to ensure hooks run.
$this->invokeCommand('internal:create-project:init-repo');
Expand Down Expand Up @@ -233,4 +238,19 @@ protected function setProjectName() {
$yamlWriter->write($project_config);
}

/**
* Sets project.name using the directory name of repo.root.
*/
protected function createCiConfig() {
$result = $this->taskFilesystemStack()
->copy($this->getConfigValue('blt.root') . '/scripts/blt/ci/internal/ci.yml', $this->getConfigValue('repo.root') . '/blt/ci.blt.yml', TRUE)
->stopOnFail()
->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
->run();

if (!$result->wasSuccessful()) {
throw new BltException("Could not initialize the CI specific BLT file.");
}
}

}

0 comments on commit bf8f785

Please sign in to comment.