mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-22 15:25:49 +00:00
add success webhook for github
This commit is contained in:
parent
4b1f6b2edd
commit
2d9066ce7a
1 changed files with 11 additions and 3 deletions
14
Jenkinsfile
vendored
14
Jenkinsfile
vendored
|
@ -20,11 +20,13 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Deploy') {
|
stage('Deploy') {
|
||||||
when {
|
echo "Branch name: $(env.BRANCH_NAME)"
|
||||||
branch 'development'
|
when {
|
||||||
|
branch 'master'
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
echo "DEPLOY!"
|
echo "Merge to master"
|
||||||
|
sh 'git pull'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +36,12 @@ pipeline {
|
||||||
}
|
}
|
||||||
success {
|
success {
|
||||||
echo 'I succeeeded!'
|
echo 'I succeeeded!'
|
||||||
|
// For GitHub
|
||||||
|
curl "https://api.GitHub.com/repos/daphneaugier/spring-petclinic/statuses/$GIT_COMMIT?access_token=<YOUR_GITHUB_TOKEN>" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-X POST \
|
||||||
|
-d "{\"state\": \"success\",\"context\": \"continuous-integration/jenkins\", \"description\": \"Jenkins\", \"target_url\": \"http://localhost:9090/job/spring-petclinic/$BUILD_NUMBER/console\"}"
|
||||||
|
// Email
|
||||||
mail to: 'daphne.augier@gmail.com',
|
mail to: 'daphne.augier@gmail.com',
|
||||||
subject: "Successful Pipeline: ${currentBuild.fullDisplayName}",
|
subject: "Successful Pipeline: ${currentBuild.fullDisplayName}",
|
||||||
body: "Eveythink OK with ${env.BUILD_URL}\n"
|
body: "Eveythink OK with ${env.BUILD_URL}\n"
|
||||||
|
|
Loading…
Reference in a new issue