Skip to content

Commit

Permalink
Add Jira Docker development environment (#918)
Browse files Browse the repository at this point in the history
* Add steps to local JIRA server instance
  • Loading branch information
srkgupta authored Mar 27, 2023
1 parent 1e10204 commit 6ccadbe
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 5 deletions.
7 changes: 7 additions & 0 deletions build/custom.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Include custom targets and environment variables here

.DEFAULT_GOAL := all

ifndef MM_RUDDER_WRITE_KEY
MM_RUDDER_WRITE_KEY = 1d5bMvdrfWClLxgK1FvV3s4U1tg
endif
Expand All @@ -13,3 +16,7 @@ LDFLAGS += -X "main.BuildHash=$(BUILD_HASH)"
LDFLAGS += -X "main.BuildHashShort=$(BUILD_HASH_SHORT)"

GO_BUILD_FLAGS = -ldflags '$(LDFLAGS)'

.PHONY: jira
jira:
docker-compose up
11 changes: 9 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
version: '3'
services:
jira:
image: atlassian/jira-software:7 # It is recommended to test with version 7. Most, if not all, compatibility issues between Jira Server/Cloud exist in version 7.
# image: atlassian/jira-software:8 # Test with version 8 as well when adding new webhook handling logic, or introducing a new Jira API call.
container_name: mattermost-jira
image: atlassian/jira-software:latest # It is recommended to test with the latest version 9, as most of the customers are using this version.
# image: atlassian/jira-software:8 # Alternatively you can test with the previous stable version 8 as well.
ports:
- "8080:8080"
environment:
- JVM_MINIMUM_MEMORY=4096m
- JVM_MAXIMUM_MEMORY=8192m
- JVM_RESERVED_CODE_CACHE_SIZE=1024m
# - ATL_TOMCAT_SCHEME='https' # Enable this in case the Jira Server is being hosted with https
# - ATL_TOMCAT_SECURE='true' # Set 'true' if ATL_TOMCAT_SCHEME is 'https'.
28 changes: 25 additions & 3 deletions docs/development/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,32 @@ Read our documentation about the [Developer Workflow](https://developers.matterm

This plugin supports both Jira Server (self-hosted) and Jira Cloud instances. There can be slight differences in behavior between the two systems, so it's best to test with both systems individually when introducing new webhook logic, or adding a new Jira API call.

To test your changes against a local instance of Jira Server, you need [Docker](https://docs.docker.com/install) installed, then you can use the `docker-compose.yml` file in this repository to create a Jira instance. Simply run `docker-compose up` in the directory of the repository, and a new Jira server should start up and be available at http://localhost:8080. It can take a few minutes to start up due to Jira Server's startup processes. If the container fails to start with `exit code 137`, you may need to increase the amount of RAM you are allowing docker to use.
To test your changes against a Jira Cloud instance, we recommend starting a 14-day trial, if you don't have a Jira project to test against. More information can be found here: https://www.atlassian.com/software/jira/try.

If you are contributing to a feature that requires multiple Jira instances to be installed, please enable [ServiceSettings.EnableDeveloper](https://docs.mattermost.com/configure/configuration-settings.html#enable-developer-mode) in your server's config in order to circumvent the Enterprise license requirement.

**Note:** You cannot use LOCALHOST to connect the Jira plugin to your server, you can use a proxy if needed.
### Run a local instance of Jira server

To test your changes against a Jira Cloud instance, we recommend starting a 14-day trial, if you don't have a Jira project to test against. More information can be found here: https://www.atlassian.com/software/jira/try.
To test your changes against a local instance of Jira Server, you need [Docker](https://docs.docker.com/install) installed.

**Pre-requisite**
As per the [sizing recommendations from Jira](https://confluence.atlassian.com/jirakb/jira-server-sizing-guide-975033809.html), it requires atleast a minimum memory of 8GB. Hence it is advised to increase the amount of resources allocated for your Docker to use. Here are the steps on how to do this using Docker Desktop:
- Click on the Settings icon on the Docker Desktop.
- Navigate to Resources section.
- Ensure that the Memory is set to at least to 8GB or more.
- Ensure that the CPUs is set to at least 4 or more.
- Click on Apply and Restart.

**Setup your local Jira server**
- Run the command `make jira` in the root of the repository to spin up the Jira server.
Note: It can take a few minutes to start up due to Jira Server's startup processes. If the container fails to start with `exit code 137`, you may need to increase the amount of RAM you are allowing docker to use.

- Once the above command completes, visit the URL http://localhost:8080 to start setting up the Jira Server.
- Select the option "Set it up for me" and click Continue to MyAtlassian.
- Select the option - "Jira Software (Data Center)" from the list of License Types.
- Enter any Organization Name and click on Generate License.
- Click on the "Yes" button on the Confirmation dialog `Please confirm that you wish to install the license key on the following server: localhost`.
- You will then be redirected to setup Administrator account. Enter all the details and click Next.
- Now sit back while the set up completes. It might take a few minutes to complete.

**Note:** It's important to note that the Jira Server can use localhost, but your MM Site URL cannot be localhost

0 comments on commit 6ccadbe

Please sign in to comment.