How to set up CI/CD for Jira Server plugin with Github Actions?

Hello.

I want to use Github Actions to set up a CI/CD pipeline for my Jira plugin. I’ve lately managed to make unit tests run with maven surfire so I’ve tried adding a simple action that would run them, but it ends up throwing an error at build step:

[INFO] Scanning for projects...
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/atlassian/maven/plugins/jira-maven-plugin/8.0.2/jira-maven-plugin-8.0.2.pom
[WARNING] The POM for com.atlassian.maven.plugins:jira-maven-plugin:jar:8.0.2 is missing, no dependency information available
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/atlassian/maven/plugins/jira-maven-plugin/8.0.2/jira-maven-plugin-8.0.2.jar
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar (169 kB at 1.7 MB/s)
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin com.atlassian.maven.plugins:jira-maven-plugin:8.0.2 or one of its dependencies could not be resolved: Could not find artifact com.atlassian.maven.plugins:jira-maven-plugin:jar:8.0.2 in central (https://repo.maven.apache.org/maven2) @ 
[ERROR] Unknown packaging: atlassian-plugin @ line 14, column 16
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.tiramisu:jira-scrum-demo:1.0.0-SNAPSHOT (/home/runner/work/FUBARio_ActionableInsights/FUBARio_ActionableInsights/pom.xml) has 2 errors
[ERROR]     Unresolveable build extension: Plugin com.atlassian.maven.plugins:jira-maven-plugin:8.0.2 or one of its dependencies could not be resolved: Could not find artifact com.atlassian.maven.plugins:jira-maven-plugin:jar:8.0.2 in central (https://repo.maven.apache.org/maven2) -> [Help 2]
[ERROR]     Unknown packaging: atlassian-plugin @ line 14, column 16
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginManagerException
##[error]Process completed with exit code 1.

I guess this is expected, as even in IntelliJ I need to set maven to version provided with the Atlassian SDK to make it all work.

So I have a question : does anyone here know how to set up Atlassian SDK along with properly configuring maven version on Github Actions ? For now I want just to make the unit tests work, but in the future I would like to be able to use atlas-run to bring up a Jira instance to run integration tests against.

Thank you kindly in advance for any input on this matter.
Cheers.

I would look into creating your own Docker container for running GitHub actions: Creating a Docker container action - GitHub Docs

1 Like

Thank you @remie . I’ve looked into it and succeeded in building an github action that runs my JIRA plugin unit and integration tests inside a specialized docker container.

If anyone is interested in seeing the code please message me directly.

Cheers.

3 Likes

Can I persuade you to consider open sourcing or publishing the GitHub action for use by the Atlassian Ecosystem community?

2 Likes

I will look into it when I have some spare time. Also as this is something I developed on company time and resources I think I’ll have to check with my supervisors if this is okay.

1 Like

Hello.

So I’ve found some time to work on what you have requested regarding publishing a Github Action for Atlassian Community.

I’ve checked with my supervisors and they have agreed to publish this as open source. So here you are : GitHub - tirasu/jira-test-action

This is really a very simple thing, it just sets up a container with latest Java JDK, Atlassian SDK 8.0.16 and your repository code and runs mvn test & mvn integration-test. For now I have confirmed it to work with the project I’ve originally developed it for. I haven’t tested it any further yet. It probably can be optimized and improved in various ways - for example adding support for using chosen version of Java and Atlassian SDK.

Please bear in mind that I’m no expert when it comes to Github Actions, Docker, Maven and so on - I’m on a junior-dev level. Therefore any contributions and advices are welcome :slight_smile:

6 Likes

That’s super cool! Thanks for sharing @MaciejWikira ! :slight_smile:

Hi @MaciejWikira Thanks for sharing!