Add Robofile commands for changelog update and get
[MAILPOET-1770]
This commit is contained in:
committed by
M. Shull
parent
e1601b20de
commit
745198e406
@ -25,3 +25,5 @@ WP_TEST_MAILER_SMTP_PASSWORD=""
|
||||
WP_SVN_USERNAME=""
|
||||
WP_SVN_PASSWORD=""
|
||||
WP_TRANSIFEX_API_TOKEN=""
|
||||
WP_JIRA_USER="" // Jira username/email
|
||||
WP_JIRA_TOKEN="" // Jira token (https://confluence.atlassian.com/cloud/api-tokens-938839638.html) or password
|
||||
|
@ -101,6 +101,9 @@ $ ./do qa:lint:javascript # JS code linter.
|
||||
$ ./do qa:phpstan # PHP code static analysis using PHPStan.
|
||||
$ ./do qa # PHP and JS linters.
|
||||
|
||||
$ ./do changelog:get [--version-name=...] # Prints out changelog and release notes for given version or for newest version.
|
||||
$ ./do changelog:update [--version-name=...] [--quiet] # Updates changelog in readme.txt for given version or for newest version.
|
||||
|
||||
$ ./do container:dump # Generates DI container cache.
|
||||
```
|
||||
|
||||
|
27
RoboFile.php
27
RoboFile.php
@ -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('.')
|
||||
|
Reference in New Issue
Block a user