@runcapsule/jirabas
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

Jirabas

Jirabas makes it easy to create next release for your app and generate Jira ticket.

Jirabas Demo

Usage

yarn add -D @runcapsule/jirabas

Add config file jirabas.config.ts to the root of the project. Config example:

import { TJirabasUserConfig } from 'jirabas'

const jirabasConfig: TJirabasUserConfig = {
  jira: {
    api: {
      host: 'kek.atlassian.net',
      email: 'jirabas@own.you',
      token: 'QWERTY',
    }
  },
  apps: {
    provider: {
      releaseTagGlob: 'app-provider_v*',
      projectKey: 'FE',
      componentName: 'My cool app 2.0',
      releaseIssueTypeName: 'Release',
      linkTypeName: 'Release',
      patchReleaseTicket: (releaseTicket: any, releaseTag: string) => {
        releaseTicket.fields.customfield_11265 = releaseTag;
        releaseTicket.fields.description = `Custom description config ${releaseTag}`;

        return releaseTicket;
      },
    },
  }
};

export default jirabasConfig

If some of app specific fields are unknown Jirabas will give you an ability to choose from multiple pulled options.

Commands

release

npx jirabas release provider
  1. Save current changes into a temporary commit
  2. Checkout to the developmennt branch. Defaults to master
  3. Pull the development branch
  4. Find commits added after a previous release tag
  5. Create changelog from these commits
  6. Checkout to the release branch. Defaults to release/<appName>
  7. Create a new release tag to the latest commit
  8. Push changes to the origin
  9. Create release ticket in Jira
  10. Checkout back to the initial branch and reset temporary commit

findAndTransition

npx jirabas findAndTransition --query "Release app-provider_v1.0.0" --status "QA Done"

Find Jira issue usgin jql: text ~"<query>" and transition it to the target status.

Configuration

To see all available flags and commands:

npx jirabas --help
npx jirabas <commandName> --help

Typing for configuration file including all possible fields:

type TJirabasConfig = {
  apps: {
    [key: string]: {
      releaseTagGlob: string
      projectKey?: string
      componentName?: string
      linkTypeName?: string
      releaseIssueTypeName?: string
      patchReleaseTicket(releaseTicket: any, releaseTag: string, tickets: any)?: any
    }
  }
  jira: {
    api: {
      host: string
      email: string
      token: string
    }
    baseUrl?: string
    ticketIDPattern?: RegExp
    excludeIssueTypes?: string[]
    includeIssueTypes?: string[]
  }
  template?: string
  transformData?(data: TTransformDataType): Promise<TTransformDataType>;
  sourceControl?: {
    devBranch?: string
    getNextReleaseBranchName(appName: string, releaseTag: string): string;
  },
}

Source typings of the config typings: src/config/config.types.ts

Readme

Keywords

none

Package Sidebar

Install

npm i @runcapsule/jirabas

Weekly Downloads

1

Version

0.3.0

License

MIT

Unpacked Size

82.8 kB

Total Files

50

Last publish

Collaborators

  • bauxy
  • gbiryukov
  • bauxy-dev
  • pkozlov