Add Robofile commands for changelog update and get

[MAILPOET-1770]
This commit is contained in:
Rostislav Wolny
2019-02-06 14:17:30 +01:00
committed by M. Shull
parent e1601b20de
commit 745198e406
3 changed files with 32 additions and 0 deletions

View File

@ -550,6 +550,22 @@ class RoboFile extends \Robo\Tasks {
->run();
}
function changelogUpdate($opts = ['version-name' => null]) {
$this->say("Updating changelog");
$outputs = $this->getChangelogController()->update($opts['version-name']);
if($opts['quiet']) {
return;
}
$this->say("Changelog \n{$outputs[0]} \n{$outputs[1]}\n\n");
$this->say("IMPORTANT NOTES \n" . ($outputs[2] ?: 'none'));
}
function changelogGet($opts = ['version-name' => null]) {
$outputs = $this->getChangelogController()->get($opts['version-name']);
$this->say("Changelog \n{$outputs[0]} \n{$outputs[1]}\n");
$this->say("IMPORTANT NOTES \n" . ($outputs[2] ?: 'none'));
}
protected function loadEnv() {
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
@ -561,6 +577,17 @@ class RoboFile extends \Robo\Tasks {
return !empty($m[1]) ? trim($m[1]) : false;
}
protected function getChangelogController() {
require_once './tasks/release/ChangelogController.php';
$this->loadEnv();
return \MailPoetTasks\Release\ChangelogController::createWithJiraCredentials(
getenv('WP_JIRA_TOKEN'),
getenv('WP_JIRA_USER'),
\MailPoetTasks\Release\Jira::PROJECT_MAILPOET,
__DIR__ . '/readme.txt'
);
}
public function testAcceptanceGroupTests() {
return $this->taskSplitTestFilesByGroups(4)
->projectRoot('.')