From 44629de6f7b164db25704ed43ea1632018cc082f Mon Sep 17 00:00:00 2001 From: subsend Date: Fri, 10 May 2019 11:21:04 +0200 Subject: [PATCH] add jenkins file for oil build pipeline [wip7] OIL-232 --- JenkinsFileBuildAndDeployIntegration | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/JenkinsFileBuildAndDeployIntegration b/JenkinsFileBuildAndDeployIntegration index fad2eca4..b61a157c 100644 --- a/JenkinsFileBuildAndDeployIntegration +++ b/JenkinsFileBuildAndDeployIntegration @@ -14,6 +14,8 @@ def sendPerSlack(color, status) { slackSend color: color, message: "${status}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL}) - Committer: ${committerEmail} - Job started by: ${buildUser}" } +def repositoryUrl + node { //Setup nodeJS from nodeJS Jenkins Plugin @@ -23,6 +25,7 @@ node { try { stage('Checkout') { checkout scm + repositoryUrl = sh(returnStdout: true, script: 'git config remote.origin.url').trim().substring('https://'.length()) sendPerSlack('#000000', "STARTED") } @@ -48,6 +51,13 @@ node { sh "npm run test:selenium" } + stage('Create Git Tag') { + withCredentials([usernamePassword(credentialsId: 'b07c4ef3-6b1b-4de1-8ba2-489266971e9a', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) { + sh "git tag -a 'build-${env.BUILD_NUMBER}' -m 'Successful build-${env.BUILD_NUMBER}'" + sh "git push https://\${GIT_USERNAME}:\${GIT_PASSWORD}@${repositoryUrl} --tags" + } + } + currentBuild.result = 'SUCCESS' } catch (e) { currentBuild.result = 'FAILED'