Skip to content
Snippets Groups Projects
Commit edd4841f authored by OZGCloud's avatar OZGCloud
Browse files

add jenkinsfile

parent 4808fb09
Branches
Tags
No related merge requests found
def FAILED_STAGE
pipeline {
agent {
node {
label 'jenkins-build-agent'
}
}
environment {
BLUE_OCEAN_URL = "https://jenkins.ozg-sh.de/job/kop-common/job/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/"
RELEASE_REGEX = /\d+.\d+.\d+/
SNAPSHOT_REGEX = /\d+.\d+.\d+-SNAPSHOT/
}
options {
timeout(time: 1, unit: 'HOURS')
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '5'))
}
stages {
stage('Check Version') {
steps {
script {
FAILED_STAGE = env.STAGE_NAME
def rootPom = readMavenPom file: 'pom.xml'
def rootVersion = rootPom.version
if(env.BRANCH_NAME == 'release'){
if ( !(rootVersion ==~ RELEASE_REGEX)) {
error("Keine Release Version für Branch ${env.BRANCH_NAME}.")
}
} else {
if ( !(rootVersion ==~ SNAPSHOT_REGEX)) {
error("Keine Snapshot Version für Branch ${env.BRANCH_NAME}.")
}
}
}
}
} //stage check version
stage('Build') {
steps {
script {
FAILED_STAGE=env.STAGE_NAME
}
}
} //stage build
} //stages
} //pipeline
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment