levonet.ci_jira_comment

CI: Jira Comment with Build Information

Build Status

This tool helps you add or update comments with build information on a Jira task.

Role Variables

  • ci_jira_api (required): The Jira API URL.
  • ci_jira_username (required): Your Jira username.
  • ci_jira_password (required): Your Jira password.
  • ci_jira_github_branch (required): The name of the Github branch, which should include the Jira task ID. For example, TODO-44.feature.
  • ci_jira_github_pr (required): The number of the Github Pull Request.
  • ci_jira_github_repository_url (optional): The URL of your Github repository.
  • ci_jira_task_filter (required): A regular expression filter for the Jira task from the Github branch. For example: (TODO|BUGS)-\d+.
  • ci_jira_message_body (optional): A message containing CI information.
  • ci_jira_message_id (optional): A unique ID for the message, needed if there's more than one message in a Jira comment.
  • ci_jira_message_title (optional): The default title is Continuous Integration.
  • ci_jira_ignore_errors (optional): Default is no.

Example Playbook

- hosts: 127.0.0.1
  connection: local
  gather_facts: no
  vars:
    ci_jira_api: https://myorg.atlassian.net/rest/api/2
    ci_jira_username: ci-bot
    ci_jira_password: secret
    ci_jira_github_branch: "{{ github_branch }}"
    ci_jira_github_pr: "{{ github_pr_number }}"
    ci_jira_github_repository_url: https://github.com/myorg/myapp
    ci_jira_task_filter: (MYAPPAPI|MYAPPDB|BUGS)-\d+
    ci_jira_message_body: |
      * App: [pr-{{ ci_jira_github_pr }}.myapp.myorg.com|http://pr-{{ ci_jira_github_pr }}.myapp.myorg.com]
      * Logs: [myapp-PR-{{ ci_jira_github_pr }}|http://grafana.myorg.com/d/XxXxXx/logs?var-host=sandbox1&var-app=myapp-PR-{{ ci_jira_github_pr }}]
      * Jenkins: [PR-{{ ci_jira_github_pr }}|http://jenkins.myorg.com/job/myapp/view/change-requests/job/PR-{{ ci_jira_github_pr }}/]
  roles:
    - role: levonet.ci_jira_comment

To run it in Jenkins:

ansible-playbook myplaybook.yml -e github_branch="${CHANGE_BRANCH}" -e github_pr_number="${CHANGE_ID}"

After running, a comment will be added to the Jira task:

Continuous Integration

License

MIT

Author Information

This tool was created by Pavlo Bashynskyi.

Informazioni sul progetto

Add new or update last CI comment with build information to Jira task.

Installa
ansible-galaxy install levonet.ci_jira_comment
Licenza
mit
Download
61.5k
Proprietario