endgen/Jenkinsfile

38 lines
1.3 KiB
Text
Raw Normal View History

2025-04-13 15:41:33 +02:00
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(
2025-04-13 15:55:38 +02:00
branches: [[name: '*/main']],
2025-04-13 15:41:33 +02:00
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
"""
}
}
}
}
}