Skip to content

Commit c8b17aa

Browse files
author
Dominick Leppich
committed
Merge pull request 'Release v24.04.2' (#7) from release_24.04.2 into master
2 parents 06eaa81 + d1139b0 commit c8b17aa

File tree

18 files changed

+247
-259
lines changed

18 files changed

+247
-259
lines changed

.github/workflows/develop-build.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish Development Build
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
branches:
9+
- 'develop'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check out source code
16+
uses: actions/checkout@v4
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 17
21+
- name: Set up Maven cache
22+
uses: actions/cache@v1
23+
with:
24+
path: ~/.m2/repository
25+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
26+
restore-keys: |
27+
${{ runner.os }}-maven-
28+
- name: Build with Maven
29+
run: mvn clean verify -U -P snapshot-build
30+
- name: Get current date
31+
id: date
32+
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S %Z')"
33+
- name: Create tag name from date
34+
id: tagdate
35+
run: echo "::set-output name=tagdate::$(date +'%Y-%m-%d_%H-%M-%S_%Z')"
36+
- name: Release
37+
id: create_release
38+
uses: softprops/action-gh-release@v2
39+
with:
40+
name: ${{ steps.date.outputs.date }}
41+
tag_name: ${{ steps.tagdate.outputs.tagdate }}
42+
generate_release_notes: true
43+
draft: false
44+
prerelease: true
45+
files: |
46+
**/target/*.jar
47+
install/*

.github/workflows/release-build.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish Release Build
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check out source code
16+
uses: actions/checkout@v4
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 17
21+
- name: Set up Maven cache
22+
uses: actions/cache@v1
23+
with:
24+
path: ~/.m2/repository
25+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
26+
restore-keys: |
27+
${{ runner.os }}-maven-
28+
- name: Build with Maven
29+
run: mvn clean verify -U -P release-build
30+
- name: Release
31+
id: create_release
32+
uses: softprops/action-gh-release@v2
33+
with:
34+
name: Release ${{ github.ref_name }}
35+
generate_release_notes: true
36+
draft: false
37+
prerelease: false
38+
files: |
39+
**/target/*.jar
40+
install/*

.github/workflows/release.yml

-52
This file was deleted.

.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
# Junk files
3+
*~
4+
.DS_Store
5+
6+
# Build
7+
target/
8+
bin/
9+
build/
10+
node_modules/
11+
12+
# Eclipse
13+
.project
14+
.classpath
15+
.settings/
16+
17+
# IntelliJ IDEA
18+
.idea
19+
*.iml
20+

Jenkinsfile

+101-17
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,133 @@
1+
12
pipeline {
23

34
agent {
45
docker {
5-
image 'maven:3-jdk-11'
6-
args '-v $HOME/.m2:/var/maven/.m2:z -u 1000 -ti -e _JAVA_OPTIONS=-Duser.home=/var/maven -e MAVEN_CONFIG=/var/maven/.m2'
6+
/* using a custom build image with a defined home directory for UID 1000 among other things */
7+
image 'nexus.intranda.com:4443/maven:3.9.3-eclipse-temurin-17'
8+
registryUrl 'https://nexus.intranda.com:4443'
9+
registryCredentialsId 'jenkins-docker'
10+
args '-v $HOME/.m2:/var/maven/.m2:z -v $HOME/.config:/var/maven/.config -v $HOME/.sonar:/var/maven/.sonar -u 1000 -ti -e _JAVA_OPTIONS=-Duser.home=/var/maven -e MAVEN_CONFIG=/var/maven/.m2'
711
}
812
}
913

1014
options {
1115
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '15', daysToKeepStr: '90', numToKeepStr: '')
1216
}
13-
14-
17+
1518
stages {
1619
stage('prepare') {
1720
steps {
18-
sh 'git clean -fdx'
21+
sh 'git reset --hard HEAD && git clean -fdx'
1922
}
2023
}
21-
22-
stage('build') {
24+
stage('build-snapshot') {
25+
when {
26+
not {
27+
anyOf {
28+
branch 'master'
29+
branch 'release_*'
30+
allOf {
31+
branch 'PR-*'
32+
expression { env.CHANGE_BRANCH.startsWith("release_") }
33+
}
34+
}
35+
}
36+
}
2337
steps {
24-
sh 'mvn -f plugin/pom.xml package'
25-
recordIssues enabledForFailure: true, aggregatingResults: true, tools: [java(), javaDoc()]
38+
sh 'mvn clean verify -U -P snapshot-build'
2639
}
2740
}
28-
29-
stage('deployment of artifacts to maven repository') {
41+
stage('build-release') {
42+
when {
43+
anyOf {
44+
branch 'master'
45+
branch 'release_*'
46+
allOf {
47+
branch 'PR-*'
48+
expression { env.CHANGE_BRANCH.startsWith("release_") }
49+
}
50+
}
51+
}
52+
steps {
53+
sh 'mvn clean verify -U -P release-build'
54+
}
55+
}
56+
stage('sonarcloud') {
57+
when {
58+
anyOf {
59+
branch 'master'
60+
branch 'release_*'
61+
branch 'sonar_*'
62+
allOf {
63+
branch 'PR-*'
64+
expression { env.CHANGE_BRANCH.startsWith("release_") }
65+
}
66+
}
67+
}
68+
steps {
69+
withCredentials([string(credentialsId: 'jenkins-sonarcloud', variable: 'TOKEN')]) {
70+
sh 'mvn verify sonar:sonar -Dsonar.token=$TOKEN -U'
71+
}
72+
}
73+
}
74+
stage('deploy-libs') {
3075
when {
3176
anyOf {
32-
tag "v*"
33-
branch 'develop'
3477
branch 'master'
78+
branch 'develop'
3579
}
3680
}
3781
steps {
38-
sh 'mvn -f plugin/pom.xml deploy'
82+
script {
83+
if (fileExists('module-lib/pom.xml')) {
84+
sh 'mvn -N deploy'
85+
sh 'mvn -f module-lib/pom.xml deploy'
86+
}
87+
}
88+
}
89+
}
90+
stage('tag release') {
91+
when { branch 'master' }
92+
steps {
93+
withCredentials([gitUsernamePassword(credentialsId: '93f7e7d3-8f74-4744-a785-518fc4d55314',
94+
gitToolName: 'git-tool')]) {
95+
sh '''#!/bin/bash -xe
96+
projectversion=$(mvn org.apache.maven.plugins:maven-help-plugin:3.4.0:evaluate -Dexpression=project.version -q -DforceStdout)
97+
if [ $? != 0 ]
98+
then
99+
exit 1
100+
elif [[ "${projectversion}" =~ "SNAPSHOT" ]]
101+
then
102+
echo "This is a SNAPSHOT version"
103+
exit 1
104+
fi
105+
echo "${projectversion}"
106+
git tag -a "v${projectversion}" -m "releasing v${projectversion}" && git push origin v"${projectversion}"
107+
'''
108+
}
39109
}
40110
}
41111
}
112+
42113
post {
114+
always {
115+
junit allowEmptyResults: true, testResults: "**/target/surefire-reports/*.xml"
116+
step([
117+
$class : 'JacocoPublisher',
118+
execPattern : '**/target/jacoco.exec',
119+
classPattern : '**/target/classes/',
120+
sourcePattern : '**/src/main/java',
121+
exclusionPattern : '**/*Test.class'
122+
])
123+
recordIssues (
124+
enabledForFailure: true, aggregatingResults: false,
125+
tools: [checkStyle(pattern: 'target/checkstyle-result.xml', reportEncoding: 'UTF-8')]
126+
)
127+
dependencyCheckPublisher pattern: 'target/dependency-check-report.xml'
128+
}
43129
success {
44-
archiveArtifacts artifacts: '**/target/*.jar, */plugin_*.xml, plugin_*.xml', fingerprint: true, onlyIfSuccessful: true
130+
archiveArtifacts artifacts: '**/target/*.jar, install/*', fingerprint: true, onlyIfSuccessful: true
45131
}
46132
changed {
47133
emailext(
@@ -53,5 +139,3 @@ pipeline {
53139
}
54140
}
55141
}
56-
57-
/* vim: set ts=2 sw=2 tw=120 et :*/

plugin/build.xml build.xml

File renamed without changes.
File renamed without changes.

module-base/pom.xml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<parent>
4+
<groupId>io.goobi.workflow.plugin</groupId>
5+
<artifactId>plugin-opac-pica</artifactId>
6+
<version>24.04.2</version>
7+
</parent>
8+
<artifactId>plugin-opac-pica-base</artifactId>
9+
<packaging>jar</packaging>
10+
</project>

plugin/.classpath

-27
This file was deleted.

plugin/.gitignore

-2
This file was deleted.

plugin/.project

-23
This file was deleted.

0 commit comments

Comments
 (0)