Commit bed6e717 authored by Richard Kosegi's avatar Richard Kosegi

Merge branch 'jenkinsfile' into 'master'

Add jenkinsfile for multibranch pipeline builds

See merge request !20
parents 383f0f06 8182337d
#!/usr/bin/groovy
@Library('gcloud-pipeline-library') _
pipeline {
agent {
label 'base7'
}
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
timeout(time: 1, unit: 'HOURS')
timestamps()
gitLabConnection('IFNE gitlab')
}
triggers {
gitlab(triggerOnPush: true, triggerOnMergeRequest: true, branchFilterType: 'All')
}
stages {
stage('Setup') {
steps {
devBuildPrepare()
}
}
stage('Quality gate') {
when {
expression {
env.BRANCH_NAME == 'master'
}
}
steps {
withSonarQubeEnv('IFNE Sonar') {
sonarRunScanner()
}
timeout(time: 1, unit: 'HOURS') {
waitForQualityGate abortPipeline: true
}
}
}
}
post {
always {
deleteDir()
}
success {
updateGitlabCommitStatus(name: 'jenkins', state: 'success')
}
failure {
updateGitlabCommitStatus(name: 'jenkins', state: 'failed')
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment