Gnosis connects GitHub pull requests and deployments to your Redmine issues via a custom webhook.
The plugin can do its magic if you follow one of these conventions:
- The git branch name contains the Redmine ticket number in the form
/\/\d+/
, e.g.feature/1337-update-rails
- The pull request description contains the Redmine ticket number in the form
/TICKET-\d+/
Have a look at the NumberExtractor
for details.
The plugin provides a webhook endpoint for GitHub to call on PR updates. Follow these steps to configure it:
- Visit
https://github.com/ORG/REPO/settings/hooks
- Click on "Add Webhook"
- Enter "Payload URL" to be Redmine URL +
/github_webhook
- The secret is up for you to decide. It's important that this string is complex and secure.
- Click "Let me select individual events." and choose "Pull Requests".
- Configure the env variable
GITHUB_WEBHOOK_SECRET
with the secret you chose.
You should now be good to go!
Important: This is optional. You can simply use pull request tracking and skip this step.
The plugin also provides a webhook to be called by SemaphoreCI. Configure it like this:
- Visit
https://ORG.semaphoreci.com/notifications
- Click on "New Notification"
- Attributes like "Name of the notification" can be chosen freely. What you need to setup is: Listing your project under
"in projects", having
/.*-deploy\.yml/
under Pipelines (this just tells the notification to send data every time a deploy script is done running), adding your Redmine URL + /semaphore_webhook to "Endpoint" and typingWEBHOOK_SECRET
into the "Secret name" field. Then go to your_org.semaphoreci.com/notifications and click on "New Secret". The "Name of the Secret" should beWEBHOOK_SECRET
. Then you create an environment variable with the "Variable Name"WEBHOOK_SECRET
. The "Value" is the secret. This should match theSEMAPHORE_WEBHOOK_SECRET
in yourconfig/application.yml
.
This should now also work just fine!
The plugin needs to query the GitHub API every now and then to match-up pull requests with deployments.
For that you need to set the GITHUB_ACCESS_TOKEN
env variable. For example you can configure it like this:
- Visit https://github.com/settings/tokens
- Click on "Generate new token"
- Click the "(classic)" option
- Check only the "repo" box.
If you make a deployment, all should correctly work now.
You may want to add your own webhooks (e.g. if you have a different CI).
Have a look at webhooks_controller_test.rb
for starters.
This work has been derived out of Anes Hodza's IPA at Renuo AG and is licensed under the MIT license. You can find the full IPA documentation here: https://github.com/aneshodza/ipa-documentation.