diff options
author | Teddy Wing | 2018-04-20 20:35:37 +0200 |
---|---|---|
committer | Teddy Wing | 2018-04-20 20:41:26 +0200 |
commit | 1e1e840df242874350195635dda63e251f6ddccb (patch) | |
tree | f63a98aac02b85404e4c47e0495fa1bfd7deb80b | |
parent | 5020d8f293eebdac74b9912aa5316abf3c9178a8 (diff) | |
download | redprine-1e1e840df242874350195635dda63e251f6ddccb.tar.bz2 |
Add README
-rw-r--r-- | README.md | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..8be3fd8 --- /dev/null +++ b/README.md @@ -0,0 +1,66 @@ +Redprine +======== + +Automatically update Redmine issues based on open pull requests. + +After opening a pull request, you might need to update the corresponding Redmine +ticket with new status information. This program does that work automatically. + +The script should be run through a service manager like `cron` or `launchd`. At +each run, it will fetch all open pull requests for the given project, and update +the corresponding Redmine issue of each new pull request. + + +## Usage +Several parameters are required to configure the script to enable it to +communicate with both GitHub and Redmine. + +Both a [GitHub personal access token][1] and Redmine API key +(`https://redmine.example.com/my/account`) are needed. + +Here’s an example script with all required arguments: + + #!/bin/sh + + redprine \ + --github-token 'GITHUB_TOKEN' \ + --github-username 'teddywing' \ + --github-owner-repo 'teddywing/redprine' \ + --redmine-base-url 'https://redmine.eaglejump.co' \ + --redmine-token 'REDMINE_TOKEN' \ + --redmine-json-params 'echo " + { + \"issue\": { + \"status_id\": 4, + \"done_ratio\": 100, + \"custom_field_values\": { + \"1\": \"$0\" + } + } + } + "' + +In `--redmine-json-params`, enter a string containing a Bash command (it will be +executed with `bash -c`). A single argument is passed in `$0` containing the URL +of the issue’s pull request. The format must match Redmine’s JSON parameter for +the [issue update API endpoint][3]. + + +## Install +Requirements: + +* `curl` +* [`jq`][2] + +Download and copy the [Redprine script][4] into your `PATH`. + + +## License +Copyright © 2018 Teddy Wing. Licensed under the GNU GPLv3+ (see the included +COPYING file). + + +[1]: https://github.com/settings/tokens +[2]: https://stedolan.github.io/jq/ +[3]: https://www.redmine.org/projects/redmine/wiki/Rest_Issues#Updating-an-issue +[4]: https://raw.githubusercontent.com/teddywing/redprine/master/redprine |