Service application for customizing gitlab and jira integration
Application is launched inside a docker container in the gitlab stage, depending on the set mode of operation, it can perform various actions:
- CHANGE_LOG: forming changeLog in a given range
- LIST_OF: comparisons of reported Jira issues and gitLab commits in a given range:
2.1. create excel report
2.2. send email notification - BUILD: run gitlab build for valid tag/branch
Application setup is divided into several modules, in the main setting, the paths to the settings files are set
jira:
login: your jira login
password: your jira password
url: https://your-domain.atlassian.net/
mask: \w{2,4}-\d{1,10}
link:
LINK:
name: DEVELOPMENT
strategy: LINK
issueTypes: ["bug", "dev"]
jql:
name: DEVELOPMENT
strategy: JQL
jql: "project = PROJECT AND \"custom_field\" = #{key}"
issueTypes: ["bug", "dev"]
default:
name: DEFAULT
strategy: DEFAULT
smtp:
disable: true
username: user.name
password: user.password
directoryPath: /
template: email.vm
gitlab:
url: https://your-domain.gitlab.com
token: quality_gate_bot_tokenParameters that need to be masked can be set as application startup parameters, example:
java -jar app.jar --jira.login=log.in --jira.password=passw0rd ... --smtp.host-mail.server.com ...quality-gate:
image: quality-gate:1.0.0 # path to docker image
stage: quality-gate
allow_failure: true
rules:
... # set start stage rules
before_script:
# Preparing custom application settings
# Setting up interaction with Jira
- cp ./${project_dir}/jira.json /src/main/resources/settings/jira.json
# Setting up interaction with GitLab
- cp ./${project_dir}/gitlab.json /src/main/resources/settings/gitlab.json
script:
- cd /app/ && java -jar app.jarUse the liberica image, depending on the architecture of your runners:
- bellsoft/liberica-openjdk-debian:17.0.6 for arm64
- bellsoft/liberica-openjdk-debian:17.0.6-x86_64 for amd64
# maven build app
mvn -e clean install
# build docker image
docker build --build-arg JAR_FILE=target/qualityGate-0.0.1-SNAPSHOT.jar -t edddoubled/quality_gate:v1 .
# run docker image
docker run -d --name quality-gate edddoubled/quality_gate:v1