From fa67bdf41bc4d59a62c8c2f5823bddd944a57c31 Mon Sep 17 00:00:00 2001 From: Johan Maasing Date: Sun, 13 Apr 2025 15:41:33 +0200 Subject: [PATCH] Add Jenkinsfile --- Jenkinsfile | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..08ef6d2 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,38 @@ +def version = '0.0.0-SNAPSHOT' +pipeline { + agent { + label 'x86' + } + tools { + maven 'Maven-3.9.9' + jdk 'Zulu-24' + } + + stages { + stage('Checkout') { + steps { + checkout scmGit( + branches: [[name: '*/master']], + userRemoteConfigs: [[ + credentialsId: 'forgejo-user-accesstoken', + url : 'https://vcs.zoom.nu/zoom/endgen.git' + ]] + ) + } + } + stage('Maven package & deploy') { + steps { + withCredentials([file(credentialsId: 'jenkins-settings.xml', variable: 'SETTINGS_XML')]) { + script { + version = sh(returnStdout: true, script: 'mvn --global-settings ${SETTINGS_XML} help:evaluate -Dexpression=project.version -q -DforceStdout') + currentBuild.description = "cluster-admin:$version" + } + echo "Building version ${version}" + sh """ + mvn --global-settings \${SETTINGS_XML} clean package deploy + """ + } + } + } + } +} \ No newline at end of file