mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-27 09:25:49 +00:00
Merge branch 'main' of https://github.com/sprientera992/spring-petclinic
This commit is contained in:
commit
5ead3a3f5d
1 changed files with 27 additions and 35 deletions
62
Jenkinsfile
vendored
62
Jenkinsfile
vendored
|
@ -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'
|
||||||
|
@ -70,25 +63,24 @@ pipeline {
|
||||||
echo: 'caught error: $err'
|
echo: 'caught error: $err'
|
||||||
}
|
}
|
||||||
sh "sshpass -p '$USERPASS' -v ssh -o StrictHostKeyChecking=no $USERNAME@${env.server_api} \"docker run --restart always --name pet -p 8081:8080 -d sprientera/pet:${env.BUILD_NUMBER}\""
|
sh "sshpass -p '$USERPASS' -v ssh -o StrictHostKeyChecking=no $USERNAME@${env.server_api} \"docker run --restart always --name pet -p 8081:8080 -d sprientera/pet:${env.BUILD_NUMBER}\""
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('get hash') {
|
||||||
|
steps {
|
||||||
|
// sh 'echo ${GIT_COMMIT_MSG}'
|
||||||
|
script {
|
||||||
|
commit = sh (script: "git log -1 --pretty=%B", , returnStdout: true).trim()
|
||||||
|
sh 'echo ${commit}'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('JIRA') {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
def testIssue = [fields: [ // id or key must present for project.
|
|
||||||
project: [id: 'DEV'],
|
|
||||||
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']]]
|
|
||||||
response = jiraEditIssue idOrKey: 'DEV-1', issue: testIssue
|
|
||||||
echo response.successful.toString()
|
|
||||||
echo response.data.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
post {
|
||||||
|
success {
|
||||||
|
echo 'I succeeded!'
|
||||||
|
jiraAddComment idOrKey: "${commit}", comment: 'build successfull from commit', site: 'butenko992'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue