From edf74071dcf33aa49ecbe393ffeaa1cf3a8f0c12 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Wed, 28 Feb 2018 06:56:47 +0000 Subject: [PATCH] Add Jenkinsfile --- Jenkinsfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..4e84469 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,28 @@ +final String gitRepoUrl = 'git@github.com:kemitix/kemitix-parent.git' +final String mvn = "mvn --batch-mode --update-snapshots" + +pipeline { + agent any + stages { + stage('Prepare') { + steps { + git url: gitRepoUrl, branch: '**', credentialsId: 'github-kemitix' + } + } + stage('Build') { + steps { + withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') { + sh "${mvn} clean install" + } + } + } + stage('Deploy') { + when { expression { (env.GIT_BRANCH == 'master') } } + steps { + withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') { + sh "${mvn} deploy --activate-profiles release" + } + } + } + } +}