|
| 1 | +# rocketchat-jira-trigger |
| 2 | + |
| 3 | +Outgoing webhook integration for [Rocket.Chat](https://rocket.chat) that summarizes any [JIRA](https://www.atlassian.com/software/jira) issues mentioned |
| 4 | + |
1 | 5 | [](https://travis-ci.org/gustavkarlsson/rocketchat-jira-trigger) |
2 | 6 | [](https://codecov.io/gh/gustavkarlsson/rocketchat-jira-trigger) |
3 | 7 | [](https://hub.docker.com/r/gustavkarlsson/rocketchat-jira-trigger) |
4 | 8 | [](https://microbadger.com/images/gustavkarlsson/rocketchat-jira-trigger) |
5 | 9 | [](https://microbadger.com/images/gustavkarlsson/rocketchat-jira-trigger) |
6 | 10 | [](https://github.com/gustavkarlsson/rocketchat-jira-trigger/blob/master/LICENSE) |
7 | 11 |
|
8 | | -# rocketchat-jira-trigger |
9 | | -Outgoing webhook integration for Rocket.Chat that summarizes any JIRA issues mentioned |
| 12 | +## Running |
10 | 13 |
|
11 | | -## Building |
12 | | -Clone the repository and run: |
| 14 | +You can run rocketchat-jira-trigger either natively (requires at [JDK 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html) to build and [JRE 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html) to run) or with [Docker](https://www.docker.com). |
13 | 15 |
|
14 | | -**Linux/OS X** |
15 | | -``` |
| 16 | +### Natively |
| 17 | + |
| 18 | +First download the [source code](https://github.com/gustavkarlsson/rocketchat-jira-trigger/releases) and run: |
| 19 | + |
| 20 | +#### Build on Linux/OS X |
| 21 | + |
| 22 | +```shell |
16 | 23 | ./gradlew installDist |
17 | 24 | ``` |
18 | | -**Windows** |
19 | | -``` |
| 25 | + |
| 26 | +#### Build on Windows |
| 27 | + |
| 28 | +```shell |
20 | 29 | gradlew.bat installDist |
21 | 30 | ``` |
22 | | -The binaries will be located in `build/install` |
| 31 | + |
| 32 | +The app will be located in `build/install`. Now run the start script with a configuration file (if you have one) as the only argument: |
| 33 | + |
| 34 | +#### Run on Linux/OS X |
| 35 | + |
| 36 | +```shell |
| 37 | +bin/rocketchat-jira-trigger config.toml |
| 38 | +``` |
| 39 | + |
| 40 | +#### Run on Windows |
| 41 | + |
| 42 | +```shell |
| 43 | +bin\rocketchat-jira-trigger.bat config.toml |
| 44 | +``` |
| 45 | + |
| 46 | +### With Docker |
| 47 | + |
| 48 | +Use the Docker cli to mount a config file (if you have one) as volume `/app/config.toml` and set up port mapping for port `4567`: |
| 49 | + |
| 50 | +```shell |
| 51 | +docker run -v $(pwd)/config.toml:/app/config.toml -p 4567:4567 --rm -it gustavkarlsson/rocketchat-jira-trigger:latest |
| 52 | +``` |
23 | 53 |
|
24 | 54 | ## Configuration |
25 | | -To get started you only need to configure the URI of your JIRA server and some user credentials (unless anonymous access is allowed). |
| 55 | + |
| 56 | +To get started you only need to configure the URI of your JIRA server and some user credentials (unless anonymous access is allowed). There are two ways to configure the application: |
| 57 | + |
| 58 | +### Config file |
| 59 | + |
26 | 60 | Create a configuration file with the `.toml` extension and set it up like this: |
27 | | -``` |
| 61 | + |
| 62 | +```toml |
28 | 63 | [jira] |
29 | 64 | uri = "https://jira.mycompany.com" |
30 | 65 | username = "someuser" |
31 | 66 | password = "somepassword" |
32 | 67 | ``` |
33 | | -If you don't want to save your password in plain text, then leave it out and you will be prompted to enter it when running the app. |
34 | | -For further configuration settings, check out the [defaults](https://github.com/gustavkarlsson/rocketchat-jira-trigger/blob/master/src/main/resources/defaults.toml). |
35 | 68 |
|
36 | | -## Running |
| 69 | +### Environment variables |
37 | 70 |
|
38 | | -### With a start script |
39 | | -Run the start scripts with a configuration file as the only argument: |
| 71 | +Set environment variables for the configuration options according to the following pattern: `<section>_<key>=<value>`. Compare this example with the above config file example to see the similarity: |
40 | 72 |
|
41 | | -**Linux/OS X** |
42 | | -``` |
43 | | -bin/rocketchat-jira-trigger config.toml |
44 | | -``` |
45 | | -**Windows** |
46 | | -``` |
47 | | -bin\rocketchat-jira-trigger.bat config.toml |
| 73 | +```shell |
| 74 | +jira_uri=https://jira.mycompany.com |
| 75 | +jira_username=someuser |
| 76 | +jira_password=somepassword |
48 | 77 | ``` |
49 | 78 |
|
50 | | -### With Docker |
51 | | -Use the `docker` cli and mount a config file as volume `/app/config.toml` and set up port mapping for port `4567`: |
52 | | -``` |
53 | | -docker run -v $(pwd)/config.toml:/app/config.toml -p 4567:4567 --rm -it gustavkarlsson/rocketchat-jira-trigger:latest |
| 79 | +For lists of values, use a comma as a separator: |
| 80 | + |
| 81 | +```shell |
| 82 | +message_default_fields=assignee,status,reporter,priority |
54 | 83 | ``` |
55 | 84 |
|
56 | | -## Trying it out |
57 | | -In Rocket.Chat, set up an outgoing webhook pointing at the server on port 4567. Example: `http://server.mycompany.com:4567/` |
| 85 | +### Reference |
| 86 | + |
| 87 | +For a list of all configuration settings, check out the [defaults](https://github.com/gustavkarlsson/rocketchat-jira-trigger/blob/master/src/main/resources/defaults.toml). |
| 88 | + |
| 89 | +### Passwords |
| 90 | + |
| 91 | +If you don't want to store your password in a file or environment variable, then leave it out and you will be prompted to enter it when running the app. |
| 92 | + |
| 93 | +## Usage |
| 94 | + |
| 95 | +In Rocket.Chat, set up an outgoing webhook pointing at the server on port `4567`. Example: `http://server.mycompany.com:4567/` |
58 | 96 | and write a message containing a known JIRA issue to try it out. Example: `Let's check out SUP-1234` |
59 | 97 |
|
60 | 98 | Rocket.Chat should reply with details about the JIRA issue. |
61 | 99 |
|
62 | | -*Tip: If you want more details, append a + like this: `Let's check out SUP-1234+`* |
| 100 | +*Tip: If you want more details, append a `+` like this: `Let's check out SUP-1234+`* |
63 | 101 |
|
64 | 102 | ## Troubleshooting |
65 | | -If your messages aren't getting any replies, first check the log. |
| 103 | + |
| 104 | +If your messages aren't getting any replies, first check the logs of Rocket.Chat and rocketchat-jira-trigger. |
66 | 105 |
|
67 | 106 | ### HTTP 403 errors |
68 | | -If you're getting HTTP 403 errors, it might be because CAPTCHA is enabled on your JIRA server and it wants you to manually re-authenticate. In that case, log out of JIRA in your browser and then log in again. |
| 107 | + |
| 108 | +If you're getting HTTP 403 errors, it might be because [CAPTCHA](https://en.wikipedia.org/wiki/CAPTCHA) is enabled on your JIRA server and it wants you to manually re-authenticate. In that case, log out of JIRA in your browser and then log in again. |
69 | 109 |
|
70 | 110 | If you're still having trouble, feel free to [create an issue](https://github.com/gustavkarlsson/rocketchat-jira-trigger/issues/new) explaining your problem. |
71 | 111 |
|
72 | | -### Connection refused when using docker |
73 | | -When using docker, you must NOT override the app port in the configuration file. The docker image is configured to |
74 | | -only export export port 4567. You can change what port the container should listen to with the `-p` option. |
| 112 | +### Connection refused when using Docker |
| 113 | + |
| 114 | +When using Docker, you must NOT override the app port in the configuration file. The Docker image is configured to |
| 115 | +only export export port `4567`. You can change what port the container should listen to with the `-p` option. |
0 commit comments