Skip to content

Commit

Permalink
add jenkins file for oil build pipeline [wip7]
Browse files Browse the repository at this point in the history
OIL-232
  • Loading branch information
subsend committed May 10, 2019
1 parent b48a5ab commit 44629de
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions JenkinsFileBuildAndDeployIntegration
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
}

Expand All @@ -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'
Expand Down

0 comments on commit 44629de

Please sign in to comment.