This commit is contained in:
Oleksandr Butenko 2021-07-15 15:09:25 +03:00
commit 5ead3a3f5d

52
Jenkinsfile vendored
View file

@ -3,26 +3,19 @@ pipeline {
registry = "sprientera/pet" registry = "sprientera/pet"
registryCredential = 'dockerhub_id' registryCredential = 'dockerhub_id'
dockerImage = '' dockerImage = ''
RELEASE_NOTES = sh (script: """git log --format="medium" -1 ${GIT_COMMIT}""", returnStdout:true)
} }
// RELEASE_NOTES = sh (script: """git log --format="medium" -1 ${GIT_COMMIT}""", returnStdout:true)
// commit = sh (script: "git log -1 --pretty=%B", , returnStdout: true).trim()
agent any agent any
stages { stages {
stage('Jira2') { // stage('Jira2') {
steps { // steps {
jiraAddComment idOrKey: 'DEV-1', comment: 'hello', site: 'butenko992' // script {
// sh 'echo ${commit}'
script { // jiraAddComment idOrKey: "${commit}", comment: 'build successfull from commit', site: 'butenko992'
env.revision = sh(script: "git log --pretty=format:\"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\" \$prevcommit...\$GIT_COMMIT", , returnStdout: true).trim() // }
version = sh(script: "echo \$PARSED_TAG | awk -F\"_\" '{print \$1}'", , returnStdout: true).trim() //}
} //}
}
}
stage('get hash') {
steps {
sh 'echo ${RELEASE_NOTES}'
sh 'echo ${GIT_COMMIT}'
}
}
stage('Build') { stage('Build') {
steps { steps {
echo 'Running build automation' echo 'Running build automation'
@ -74,21 +67,20 @@ pipeline {
} }
} }
} }
stage('JIRA') { stage('get hash') {
steps { steps {
// sh 'echo ${GIT_COMMIT_MSG}'
script { script {
def testIssue = [fields: [ // id or key must present for project. commit = sh (script: "git log -1 --pretty=%B", , returnStdout: true).trim()
project: [id: 'DEV'], sh 'echo ${commit}'
summary: 'New JIRA Created from Jenkins.', }
description: 'New JIRA Created from Jenkins.', }
customfield_1000: 'customValue', }
// id or name must present for issuetype. }
issuetype: [id: '3']]] post {
response = jiraEditIssue idOrKey: 'DEV-1', issue: testIssue success {
echo response.successful.toString() echo 'I succeeded!'
echo response.data.toString() jiraAddComment idOrKey: "${commit}", comment: 'build successfull from commit', site: 'butenko992'
} }
} }
}
}
} }