@temptek/semantic-release-jira
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -0,1 +1,8 @@ | ||
# [0.3.0](https://github.com/boxcee/semantic-release-jira-releases/compare/v0.2.0...v0.3.0) (2021-09-03) | ||
### Features | ||
* add option to not run on prerelease branches ([37fa1fc](https://github.com/boxcee/semantic-release-jira-releases/commit/37fa1fc3194e3ac37186075623696f4fb092d659)) | ||
# [0.2.0](https://github.com/boxcee/semantic-release-jira-releases/compare/v0.1.0...v0.2.0) (2021-09-02) | ||
@@ -2,0 +9,0 @@ |
@@ -104,27 +104,31 @@ "use strict"; | ||
var _a, _b; | ||
const tickets = getTickets(config, context); | ||
context.logger.info(`Found ticket ${tickets.join(', ')}`); | ||
const versionTemplate = _.template((_a = config.releaseNameTemplate) !== null && _a !== void 0 ? _a : types_1.DEFAULT_VERSION_TEMPLATE); | ||
const newVersionName = versionTemplate({ version: context.nextRelease.version, env: context.env }); | ||
const descriptionTemplate = _.template((_b = config.releaseDescriptionTemplate) !== null && _b !== void 0 ? _b : types_1.DEFAULT_RELEASE_DESCRIPTION_TEMPLATE); | ||
const newVersionDescription = descriptionTemplate({ version: context.nextRelease.version, notes: context.nextRelease.notes, env: context.env }); | ||
context.logger.info(`Using jira release '${newVersionName}'`); | ||
const version3Client = (0, jira_1.makeVersion3Client)(config, context); | ||
let activeSprint; | ||
if (config.useBoardForActiveSprint) { | ||
const agileClient = (0, jira_1.makeAgileClient)(config, context); | ||
const boards = await agileClient.board.getAllBoards({ projectKeyOrId: config.projectId }); | ||
const board = boards.values.find(b => b.name === config.useBoardForActiveSprint); | ||
if (board) { | ||
const sprints = await agileClient.board.getAllSprints({ boardId: board.id }); | ||
activeSprint = sprints.values.find(s => s.state === 'active'); | ||
const isPrerelease = typeof context.branch !== 'string' && context.branch.prerelease; | ||
const runOnPrerelease = config.runOnPrerelease === undefined || config.runOnPrerelease; | ||
if (!isPrerelease || (isPrerelease && runOnPrerelease)) { | ||
const tickets = getTickets(config, context); | ||
context.logger.info(`Found ticket ${tickets.join(', ')}`); | ||
const versionTemplate = _.template((_a = config.releaseNameTemplate) !== null && _a !== void 0 ? _a : types_1.DEFAULT_VERSION_TEMPLATE); | ||
const newVersionName = versionTemplate({ version: context.nextRelease.version, env: context.env }); | ||
const descriptionTemplate = _.template((_b = config.releaseDescriptionTemplate) !== null && _b !== void 0 ? _b : types_1.DEFAULT_RELEASE_DESCRIPTION_TEMPLATE); | ||
const newVersionDescription = descriptionTemplate({ version: context.nextRelease.version, notes: context.nextRelease.notes, env: context.env }); | ||
context.logger.info(`Using jira release '${newVersionName}'`); | ||
const version3Client = (0, jira_1.makeVersion3Client)(config, context); | ||
let activeSprint; | ||
if (config.useBoardForActiveSprint) { | ||
const agileClient = (0, jira_1.makeAgileClient)(config, context); | ||
const boards = await agileClient.board.getAllBoards({ projectKeyOrId: config.projectId }); | ||
const board = boards.values.find(b => b.name === config.useBoardForActiveSprint); | ||
if (board) { | ||
const sprints = await agileClient.board.getAllSprints({ boardId: board.id }); | ||
activeSprint = sprints.values.find(s => s.state === 'active'); | ||
} | ||
} | ||
const project = await version3Client.projects.getProject({ projectIdOrKey: config.projectId }); | ||
const releaseVersion = await findOrCreateVersion(config, context, version3Client, project, newVersionName, newVersionDescription, activeSprint); | ||
const concurrentLimit = (0, p_limit_1.default)(config.networkConcurrency || 10); | ||
const edits = tickets.map(issueKey => concurrentLimit(() => editIssueFixVersions(config, context, version3Client, newVersionName, releaseVersion.id, issueKey))); | ||
await Promise.all(edits); | ||
} | ||
const project = await version3Client.projects.getProject({ projectIdOrKey: config.projectId }); | ||
const releaseVersion = await findOrCreateVersion(config, context, version3Client, project, newVersionName, newVersionDescription, activeSprint); | ||
const concurrentLimit = (0, p_limit_1.default)(config.networkConcurrency || 10); | ||
const edits = tickets.map(issueKey => concurrentLimit(() => editIssueFixVersions(config, context, version3Client, newVersionName, releaseVersion.id, issueKey))); | ||
await Promise.all(edits); | ||
} | ||
exports.success = success; | ||
//# sourceMappingURL=success.js.map |
{ | ||
"name": "@temptek/semantic-release-jira", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"main": "dist/lib/index.js", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
32120
274