From 67f584fa08410ae2bccaec3a11a1dbe5a3b168d3 Mon Sep 17 00:00:00 2001 From: Gaurav Katiyar Date: Wed, 30 May 2018 12:41:53 +0100 Subject: [PATCH] Added jenkins file --- Jenkinsfile | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..ef98144e5 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,45 @@ +// +// CTC Auth Jenkins Pipeline +// +pipeline { + agent any + tools { + maven 'Maven 3.3.9' + jdk 'Java 8' + } + options { + // Only keep 10 builds in total + buildDiscarder(logRotator(numToKeepStr:'10', daysToKeepStr:'2')) + + // Display timestamps + timestamps() + + // Prevent concurrent builds + disableConcurrentBuilds(); + } + stages { + stage ('Build') { + steps { + timeout(time: 20, unit: 'MINUTES') { + sh 'mvn versions:set -DnewVersion=1.3.3-${env.BUILD_NUMBER}' + } + timeout(time: 20, unit: 'MINUTES') { + sh 'mvn -B -V -U -T4 clean deploy -DaltDeploymentRepository=releases::default::https://nexus.greshamtech.com/content/repositories/thirdparty' + } + } + post { + always{ + archiveArtifacts caseSensitive: false, onlyIfSuccessful: true, allowEmptyArchive: true, artifacts: 'openid-connect-server-webapp/target/*.war' + } + success { + junit '**/target/surefire-reports/**/*.xml' + } + } + } + } + post { + always { + deleteDir() + } + } +}