Skip to content

Instantly share code, notes, and snippets.

@MBM1607
Last active January 1, 2024 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MBM1607/b1abc181b4dc0f241d6f6136c50eb65e to your computer and use it in GitHub Desktop.
Save MBM1607/b1abc181b4dc0f241d6f6136c50eb65e to your computer and use it in GitHub Desktop.
GitHub Integration Instructions

GitHub Integration

This is a Plugin for one-way integration between GitHub & Redmine. This plugin has a scheduled task that can run at a customizable interval to fetch all projects & issues from a GitHub account and save them in Redmine.

Features

  • Syncs GitHub projects with Redmine projects
  • Syncs GitHub issues in each project with Redmine issues in the corresponding project
    • Syncs GitHub issue comments with Redmine issue notes
    • Syncs GitHub issue assignee with Redmine issue assignee

Requirements

This plugin requires Redmine 5.0.0 or higher. The previous versions of Redmine are not supported. The plugin is tested with Redmine 5.1.1, but it should work with any Redmine version that uses Rails 6.x or higher.

Credentials

The personal access token must be created from Github Developer Settings.

The following permissions are required:

Repository permissions

  • Issues - Access: Read-Only - to read issues
  • Metadata - Access: Read-Only - Mandatory in order to be able to read Issues

Organization permissions

  • Projects - Access: Read-Only - to read projects

Setup

  1. Install the plugin
    1. Clone the plugin source code into plugins/github_integration
      1. git clone https://github.com/techhive-solutions/redmine-github-integration plugins/github_integration
      2. Or download the source code and extract it into plugins/github_integration
    2. Install the dependencies
      1. bundle install
    3. Migrate the database
      1. bundle exec rake redmine:plugins:migrate
  2. Restart Redmine
  3. Go to Administration > Plugins > GitHub Integration plugin > Configure
  4. Enter the GitHub credentials:
    1. Enter the GitHub organization name
    2. Enter the GitHub personal access token, created as per the Credentials section
  5. Click Apply to save the settings

Usage

The rake task can be run as follows:

RAILS_ENV=production bundle exec rake github:sync

You can schedule the rake task to run at a specific interval using crontab. Add the following line to your crontab:

0 * * * * cd /path/to/redmine && RAILS_ENV=production bundle exec rake github:sync

This runs the rake task every hour at the beginning of the hour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment