Skip to content

Commit 05f1299

Browse files
committed
Added kotlin-jira-client
0 parents  commit 05f1299

File tree

98 files changed

+7145
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+7145
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
generated-test-resources.zip filter=lfs diff=lfs merge=lfs -text

.github/workflows/default.yml

Lines changed: 266 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,266 @@
1+
name: kotlin-client - default
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
release:
7+
types: [ created ]
8+
schedule:
9+
- cron: '0 2 * * 2' # At 02:00 on Tuesday
10+
11+
env:
12+
MAIN_BRANCH: 'dev'
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-20.04
17+
outputs:
18+
version: ${{ steps.extract-version.outputs.version }}
19+
steps:
20+
- name: Checkout Source
21+
uses: actions/checkout@v3
22+
with:
23+
lfs: true
24+
25+
- name: Download Maven Cache
26+
uses: actions/cache@v3
27+
with:
28+
path: ~/.m2/repository
29+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
30+
restore-keys: |
31+
${{ runner.os }}-maven-
32+
33+
- name: Setup JDK 1.8
34+
uses: actions/setup-java@v3
35+
with:
36+
java-version: '8'
37+
distribution: 'adopt'
38+
39+
- name: Extract and Set Release Version
40+
if: ${{ github.event_name == 'release' }}
41+
id: extract-version
42+
run: |
43+
VERSION=$(git describe --tags | cut -d v -f2)
44+
echo "Detected version = $VERSION"
45+
echo "version=$VERSION" >> $GITHUB_OUTPUT
46+
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
47+
48+
- name: Build library
49+
run: mvn package -Pci "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
50+
51+
test-ktor:
52+
runs-on: ubuntu-20.04
53+
needs: build
54+
steps:
55+
- name: Checkout Source
56+
uses: actions/checkout@v3
57+
with:
58+
lfs: true
59+
60+
- name: Download Maven Cache
61+
uses: actions/cache@v3
62+
with:
63+
path: ~/.m2/repository
64+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
65+
restore-keys: |
66+
${{ runner.os }}-maven-
67+
68+
- name: Setup JDK 1.8
69+
uses: actions/setup-java@v3
70+
with:
71+
java-version: '8'
72+
distribution: 'adopt'
73+
74+
- name: Set Release Version
75+
if: ${{ github.event_name == 'release' }}
76+
id: extract-version
77+
run: |
78+
VERSION="${{ needs.build.outputs.version }}"
79+
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
80+
81+
- name: Startup Jira and Insight
82+
# Loop is needed to prevent Jira from suspension
83+
run: (while true; do sleep 10000; done) | mvn jira:debug -Pjira-maven "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://localhost:2990" -pl -kotlin-jira-client-api,-kotlin-jira-client-http,-kotlin-jira-client-sdk,-kotlin-jira-client-test-base,-kotlin-jira-client-test-ktor,-kotlin-jira-client-test-sdk,-kotlin-jira-client-test-applink &
84+
85+
- name: Wait for Jira and Insight
86+
run: ./scripts/wait-for-jira.sh
87+
88+
- name: Integration tests using ktor
89+
run: mvn -B verify -Pci-ktor -pl -kotlin-jira-client-test-sdk,-kotlin-jira-client-test-applink "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
90+
91+
test-applink:
92+
runs-on: ubuntu-20.04
93+
needs: build
94+
steps:
95+
- name: Checkout Source
96+
uses: actions/checkout@v3
97+
with:
98+
lfs: true
99+
100+
- name: Download Maven Cache
101+
uses: actions/cache@v3
102+
with:
103+
path: ~/.m2/repository
104+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
105+
restore-keys: |
106+
${{ runner.os }}-maven-
107+
108+
- name: Setup JDK 1.8
109+
uses: actions/setup-java@v3
110+
with:
111+
java-version: '8'
112+
distribution: 'adopt'
113+
114+
- name: Set Release Version
115+
if: ${{ github.event_name == 'release' }}
116+
id: extract-version
117+
run: |
118+
VERSION="${{ needs.build.outputs.version }}"
119+
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
120+
121+
- name: Startup Jira and Insight
122+
run: (while true; do sleep 10000; done) | mvn jira:debug -Pjira-maven "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://localhost:2990" -pl -kotlin-jira-client-api,-kotlin-jira-client-http,-kotlin-jira-client-sdk,-kotlin-jira-client-test-base,-kotlin-jira-client-test-ktor,-kotlin-jira-client-test-sdk,-kotlin-jira-client-test-applink &
123+
124+
- name: Wait for Jira and Insight
125+
run: ./scripts/wait-for-jira.sh
126+
127+
- name: Add hosts to /etc/hosts
128+
run: sudo echo "127.0.0.1 confluence" | sudo tee -a /etc/hosts
129+
130+
- name: Integration tests using applinks
131+
run: mvn -B verify -Pci-applink "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" -Dbaseurl=http://confluence:1990 -pl -kotlin-jira-client-test-sdk,-kotlin-jira-client-test-ktor
132+
133+
test-sdk:
134+
runs-on: ubuntu-20.04
135+
needs: build
136+
steps:
137+
- name: Checkout Source
138+
uses: actions/checkout@v3
139+
with:
140+
lfs: true
141+
142+
- name: Download Maven Cache
143+
uses: actions/cache@v3
144+
with:
145+
path: ~/.m2/repository
146+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
147+
restore-keys: |
148+
${{ runner.os }}-maven-
149+
150+
- name: Setup JDK 1.8
151+
uses: actions/setup-java@v3
152+
with:
153+
java-version: '8'
154+
distribution: 'adopt'
155+
156+
- name: Set Release Version
157+
if: ${{ github.event_name == 'release' }}
158+
id: extract-version
159+
run: |
160+
VERSION="${{ needs.build.outputs.version }}"
161+
mvn -B versions:set "-DnewVersion=$VERSION" "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
162+
163+
- name: Integration tests using sdk
164+
run: mvn clean -B verify -Pci-sdk "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" "-Dbaseurl=http://localhost:2990" -pl -kotlin-jira-client-test-ktor,-kotlin-jira-client-test-applink
165+
166+
deploy-to-central:
167+
runs-on: ubuntu-20.04
168+
needs: [ build, test-sdk, test-ktor, test-applink ]
169+
if: ${{ github.event_name == 'release' }}
170+
steps:
171+
- name: Checkout Source
172+
uses: actions/checkout@v3
173+
with:
174+
lfs: true
175+
176+
- name: Download Maven Cache
177+
uses: actions/cache@v3
178+
with:
179+
path: ~/.m2/repository
180+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
181+
restore-keys: |
182+
${{ runner.os }}-maven-
183+
184+
- name: Setup JDK 1.8
185+
uses: actions/setup-java@v3
186+
with:
187+
java-version: '8'
188+
distribution: 'adopt'
189+
190+
- name: Extract, set and commit Release Version
191+
id: extract-version
192+
run: |
193+
git config user.email "actions@github.com"
194+
git config user.name "GitHub Actions"
195+
196+
VERSION="${{ needs.build.outputs.version }}"
197+
mvn -B versions:set "-DnewVersion=$VERSION" versions:commit "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
198+
199+
git commit -am "[skip ci] set release version $VERSION"
200+
git push origin HEAD:$MAIN_BRANCH
201+
202+
TAG_NAME="v$VERSION"
203+
git tag -f $TAG_NAME
204+
git push origin -f --tags
205+
206+
- name: Install GPG Secret Key
207+
id: install-secret-key
208+
run: cat <(echo -e "${{ secrets.SIGNING_KEY }}") | gpg --batch --import
209+
210+
- name: Deploy to Maven Central
211+
run: mvn -B deploy -Pci -DskipTests "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}" -pl -kotlin-jira-client-test-base,-kotlin-jira-client-test-applink,-kotlin-jira-client-test-ktor,-kotlin-jira-client-test-sdk
212+
env:
213+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
214+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
215+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
216+
217+
prepare-next-snapshot:
218+
runs-on: ubuntu-20.04
219+
needs: [ build, deploy-to-central ]
220+
if: ${{ github.event_name == 'release' }}
221+
steps:
222+
- name: Checkout Source
223+
uses: actions/checkout@v3
224+
225+
- name: Download Maven Cache
226+
uses: actions/cache@v3
227+
with:
228+
path: ~/.m2/repository
229+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
230+
restore-keys: |
231+
${{ runner.os }}-maven-
232+
233+
- name: Setup JDK 1.8
234+
uses: actions/setup-java@v3
235+
with:
236+
java-version: '8'
237+
distribution: 'adopt'
238+
239+
- name: Prepare next Snapshot Version
240+
run: |
241+
git config user.email "actions@github.com"
242+
git config user.name "GitHub Actions"
243+
git fetch origin $MAIN_BRANCH
244+
git reset --hard origin/$MAIN_BRANCH
245+
246+
VERSION="${{ needs.build.outputs.version }}"
247+
MAJOR_VERSION=$(echo "$VERSION" | cut -d . -f1)
248+
MINOR_VERSION=$(echo "$VERSION" | cut -d . -f2)
249+
INCREMENT_VERSION=$(echo "$VERSION" | cut -d . -f3)
250+
NEXT_INCREMENT_VERSION=$((INCREMENT_VERSION + 1))
251+
NEXT_SNAPSHOT_VERSION="$MAJOR_VERSION.$MINOR_VERSION.$NEXT_INCREMENT_VERSION-SNAPSHOT"
252+
mvn -B versions:set "-DnewVersion=$NEXT_SNAPSHOT_VERSION" versions:commit "-Djira.service.management.license=${{ secrets.JIRA_SERVICE_MANAGEMENT_LICENSE }}" "-Dconfluence.license=${{ secrets.CONFLUENCE_LICENSE }}"
253+
git commit -am "[skip ci] set development version $NEXT_SNAPSHOT_VERSION"
254+
git push origin HEAD:$MAIN_BRANCH
255+
256+
notify-slack:
257+
needs: prepare-next-snapshot
258+
if: always()
259+
runs-on: ubuntu-20.04
260+
steps:
261+
- name: Notify Slack
262+
if: ${{ github.ref == env.MAIN_BRANCH_FULL || github.event_name == 'release' }}
263+
uses: iRoachie/slack-github-actions@v2.3.2
264+
env:
265+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
266+
GITHUB_TOKEN: ${{ secrets.GH_API_TOKEN }}

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/.gradle/*
2+
/.gradle
3+
/.idea
4+
/build
5+
/build/*
6+
*/build/*
7+
/target/*
8+
*/target/*

.mvn/local-settings.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
This settings file overrides the default user settings file. This way all required dependencies can be resolved using
5+
the atlassian-public repository as a mirror for the central repository.
6+
-->
7+
8+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
9+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
11+
<mirrors>
12+
<mirror>
13+
<id>atlassian-central</id>
14+
<mirrorOf>central</mirrorOf>
15+
<name>atlassian-central</name>
16+
<url>https://maven.atlassian.com/repository/public</url>
17+
</mirror>
18+
</mirrors>
19+
20+
<servers>
21+
<server>
22+
<id>maven-central-nexus</id>
23+
<username>${env.SONATYPE_USERNAME}</username>
24+
<password>${env.SONATYPE_PASSWORD}</password>
25+
</server>
26+
</servers>
27+
</settings>

.mvn/maven.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--settings .mvn/local-settings.xml
2+
-Djira.service.management.license=
3+
-Dconfluence.license=

0 commit comments

Comments
 (0)