protected function RoboFile::checkoutManyreposForRelease in Panopoly 7
Checks out the many repos for the purpose of making a release.
Parameters
string $branch: The branch to checkout.
bool $clean: If TRUE, then delete the repos before checking them out; if FALSE, try to simply update the repos already there (if any).
Return value
\Robo\Collection\CollectionBuilder
3 calls to RoboFile::checkoutManyreposForRelease()
- RoboFile::releaseCreate in ./
RoboFile.php - Release Stage 1: results in local tag and commit for the new version.
- RoboFile::releasePublish in ./
RoboFile.php - Release Stage 3: Publishes new releases on Drupal.org.
- RoboFile::releasePush in ./
RoboFile.php - Release Stage 2: Pushes commits and tags to the Git remote.
File
- ./
RoboFile.php, line 660
Class
- RoboFile
- This is project's console commands configuration for Robo task runner.
Code
protected function checkoutManyreposForRelease($branch, $clean = FALSE) {
/** @var \Robo\Collection\CollectionBuilder|$this $collection */
$collection = $this
->collectionBuilder();
// Create (and optionally clean) the release directory.
if ($clean) {
$this
->_deleteDir('release');
}
if (!file_exists('release')) {
$collection
->taskFileSystemStack()
->mkdir('release');
}
// Check out the individual manyrepos for the child modules.
foreach ($this
->getPanopolyFeatures() as $panopoly_feature) {
$panopoly_feature_release_path = "release/{$panopoly_feature}";
if (!file_exists($panopoly_feature_release_path)) {
$collection
->taskExec("git clone git@git.drupal.org:project/{$panopoly_feature}.git --branch {$branch} {$panopoly_feature_release_path}");
}
else {
$collection
->taskExecStack()
->exec("git -C {$panopoly_feature_release_path} checkout {$branch}")
->exec("git -C {$panopoly_feature_release_path} pull")
->exec("git -C {$panopoly_feature_release_path} pull --tags");
}
}
return $collection;
}