Skip to content

Commit

Permalink
Merge pull request 'Release v24.04.2' (#5) from release_24.04.2 into …
Browse files Browse the repository at this point in the history
…master
  • Loading branch information
skutsch committed May 6, 2024
2 parents 41c560b + e0be8cf commit c625c5d
Show file tree
Hide file tree
Showing 33 changed files with 254 additions and 372 deletions.
27 changes: 0 additions & 27 deletions .classpath

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/develop-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish Development Build

permissions:
contents: write

on:
push:
branches:
- 'develop'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Set up Maven cache
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn clean verify -U -P snapshot-build
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S %Z')"
- name: Create tag name from date
id: tagdate
run: echo "::set-output name=tagdate::$(date +'%Y-%m-%d_%H-%M-%S_%Z')"
- name: Release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: ${{ steps.date.outputs.date }}
tag_name: ${{ steps.tagdate.outputs.tagdate }}
generate_release_notes: true
draft: false
prerelease: true
files: |
**/target/*.jar
install/*
40 changes: 40 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish Release Build

permissions:
contents: write

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Set up Maven cache
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn clean verify -U -P release-build
- name: Release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ github.ref_name }}
generate_release_notes: true
draft: false
prerelease: false
files: |
**/target/*.jar
install/*
62 changes: 0 additions & 62 deletions .github/workflows/release.yml

This file was deleted.

22 changes: 20 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
/bin/
/target/

# Junk files
*~
.DS_Store

# Build
target/
bin/
build/
node_modules/

# Eclipse
.project
.classpath
.settings/

# IntelliJ IDEA
.idea
*.iml

23 changes: 0 additions & 23 deletions .project

This file was deleted.

6 changes: 0 additions & 6 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

4 changes: 0 additions & 4 deletions .settings/org.eclipse.m2e.core.prefs

This file was deleted.

121 changes: 108 additions & 13 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,133 @@

pipeline {

agent {
docker {
image 'maven:3-jdk-11'
args '-v $HOME/.m2:/var/maven/.m2:z -u 1000 -ti -e _JAVA_OPTIONS=-Duser.home=/var/maven -e MAVEN_CONFIG=/var/maven/.m2'
/* using a custom build image with a defined home directory for UID 1000 among other things */
image 'nexus.intranda.com:4443/maven:3.9.3-eclipse-temurin-17'
registryUrl 'https://nexus.intranda.com:4443'
registryCredentialsId 'jenkins-docker'
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'
}
}

options {
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '15', daysToKeepStr: '90', numToKeepStr: '')
}



stages {
stage('prepare') {
steps {
sh 'git clean -fdx'
sh 'git reset --hard HEAD && git clean -fdx'
}
}

stage('build') {
stage('build-snapshot') {
when {
not {
anyOf {
branch 'master'
branch 'release_*'
allOf {
branch 'PR-*'
expression { env.CHANGE_BRANCH.startsWith("release_") }
}
}
}
}
steps {
sh 'mvn clean verify -U -P snapshot-build'
}
}
stage('build-release') {
when {
anyOf {
branch 'master'
branch 'release_*'
allOf {
branch 'PR-*'
expression { env.CHANGE_BRANCH.startsWith("release_") }
}
}
}
steps {
sh 'mvn clean verify -U -P release-build'
}
}
stage('sonarcloud') {
when {
anyOf {
branch 'master'
branch 'release_*'
branch 'sonar_*'
allOf {
branch 'PR-*'
expression { env.CHANGE_BRANCH.startsWith("release_") }
}
}
}
steps {
sh 'mvn -f plugin/pom.xml package'
recordIssues enabledForFailure: true, aggregatingResults: true, tools: [java(), javaDoc()]
withCredentials([string(credentialsId: 'jenkins-sonarcloud', variable: 'TOKEN')]) {
sh 'mvn verify sonar:sonar -Dsonar.token=$TOKEN -U'
}
}
}
stage('deploy-libs') {
when {
anyOf {
branch 'master'
branch 'develop'
}
}
steps {
script {
if (fileExists('module-lib/pom.xml')) {
sh 'mvn -N deploy'
sh 'mvn -f module-lib/pom.xml deploy'
}
}
}
}
stage('tag release') {
when { branch 'master' }
steps {
withCredentials([gitUsernamePassword(credentialsId: '93f7e7d3-8f74-4744-a785-518fc4d55314',
gitToolName: 'git-tool')]) {
sh '''#!/bin/bash -xe
projectversion=$(mvn org.apache.maven.plugins:maven-help-plugin:3.4.0:evaluate -Dexpression=project.version -q -DforceStdout)
if [ $? != 0 ]
then
exit 1
elif [[ "${projectversion}" =~ "SNAPSHOT" ]]
then
echo "This is a SNAPSHOT version"
exit 1
fi
echo "${projectversion}"
git tag -a "v${projectversion}" -m "releasing v${projectversion}" && git push origin v"${projectversion}"
'''
}
}
}
}

post {
always {
junit allowEmptyResults: true, testResults: "**/target/surefire-reports/*.xml"
step([
$class : 'JacocoPublisher',
execPattern : '**/target/jacoco.exec',
classPattern : '**/target/classes/',
sourcePattern : '**/src/main/java',
exclusionPattern : '**/*Test.class'
])
recordIssues (
enabledForFailure: true, aggregatingResults: false,
tools: [checkStyle(pattern: 'target/checkstyle-result.xml', reportEncoding: 'UTF-8')]
)
dependencyCheckPublisher pattern: 'target/dependency-check-report.xml'
}
success {
archiveArtifacts artifacts: '**/target/*.jar, */plugin_*.xml, plugin_*.xml', fingerprint: true, onlyIfSuccessful: true
archiveArtifacts artifacts: '**/target/*.jar, install/*', fingerprint: true, onlyIfSuccessful: true
}
changed {
emailext(
Expand All @@ -42,5 +139,3 @@ pipeline {
}
}
}

/* vim: set ts=2 sw=2 tw=120 et :*/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit c625c5d

Please sign in to comment.