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

edit jenkins pipeline

parent b2423b1f
Branches
Tags
No related merge requests found
def FAILED_STAGE
pipeline { pipeline {
agent { agent {
node { node {
...@@ -5,14 +7,22 @@ pipeline { ...@@ -5,14 +7,22 @@ pipeline {
} }
} }
environment {
BLUE_OCEAN_URL = "https://jenkins-dev-tools.apps.lab.okd.local/blue/organizations/jenkins/OZG%2Fintelliform-adapter/detail/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/pipeline"
}
options { options {
timeout(time: 1, unit: 'HOURS') timeout(time: 1, unit: 'HOURS')
disableConcurrentBuilds() disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '5'))
} }
stages { stages {
stage('build intelliform-adapter') { stage('build intelliform-adapter') {
steps { steps {
script {
FAILED_STAGE=env.STAGE_NAME
}
container("maven"){ container("maven"){
sh 'mvn --version' sh 'mvn --version'
sh 'mvn clean install' sh 'mvn clean install'
...@@ -28,6 +38,8 @@ pipeline { ...@@ -28,6 +38,8 @@ pipeline {
stage('openshift deploy') { stage('openshift deploy') {
steps { steps {
script { script {
FAILED_STAGE=env.STAGE_NAME
def pom = readMavenPom file: 'pom.xml' def pom = readMavenPom file: 'pom.xml'
def version = pom.version def version = pom.version
...@@ -39,9 +51,34 @@ pipeline { ...@@ -39,9 +51,34 @@ pipeline {
openshift.tag("if-adapter-builder:${env.BRANCH_NAME}-${version}", "sh-eingang-dev/if-adapter:${env.BRANCH_NAME}-${version}") openshift.tag("if-adapter-builder:${env.BRANCH_NAME}-${version}", "sh-eingang-dev/if-adapter:${env.BRANCH_NAME}-${version}")
} }
if (env.BRANCH_NAME == 'master') {
openshift.withProject('sh-eingang-dev') {
def dc = openshift.selector('deployments', 'if-adapter')
dc.rollout().status()
}
}
}
} }
} }
} }
} }
post {
success {
script {
if (env.BRANCH_NAME == 'master') {
slackSend(color: "good", message: "Intelliform-Adapter: Build Succeeded. Build-ID: <${BLUE_OCEAN_URL}|${env.BUILD_NUMBER}>")
}
}
}
failure {
script {
if (env.BRANCH_NAME == 'master') {
slackSend(color: "danger", message: "Intelliform-Adapter: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <${BLUE_OCEAN_URL}|${env.BUILD_NUMBER}>")
}
}
}
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment