mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 23:05:50 +00:00
reset
This commit is contained in:
parent
c12cf48146
commit
f0494f5fcc
1 changed files with 6 additions and 63 deletions
69
Jenkinsfile
vendored
69
Jenkinsfile
vendored
|
@ -1,63 +1,6 @@
|
|||
#!/usr/bin/env groovy
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh './mvnw clean'
|
||||
}
|
||||
}
|
||||
stage('Test') {
|
||||
steps {
|
||||
sh './mvnw test'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Package') {
|
||||
steps {
|
||||
sh './mvnw package'
|
||||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
when {
|
||||
branch 'development'
|
||||
}
|
||||
steps {
|
||||
echo "Branch name: ${env.BRANCH_NAME}"
|
||||
sh './mvnw deploy'
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
echo 'One way or another, I have finished'
|
||||
}
|
||||
success {
|
||||
echo 'I succeeeded!'
|
||||
// For GitHub
|
||||
sh 'curl "https://api.GitHub.com/repos/daphneaugier/spring-petclinic/statuses/$GIT_COMMIT?access_token=5cff02b111407f3c0bd4e30c8fb215c1369c46e3" \
|
||||
-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',
|
||||
subject: "Successful Pipeline: ${currentBuild.fullDisplayName}",
|
||||
body: "Eveythink OK with ${env.BUILD_URL}\n"
|
||||
}
|
||||
unstable {
|
||||
echo 'I am unstable :/'
|
||||
}
|
||||
failure {
|
||||
echo 'I failed :('
|
||||
// For GitHub
|
||||
sh 'curl "https://api.GitHub.com/repos/daphneaugier/spring-petclinic/statuses/$GIT_COMMIT?access_token=5cff02b111407f3c0bd4e30c8fb215c1369c46e3" \
|
||||
-H "Content-Type: application/json" \
|
||||
-X POST \
|
||||
-d "{\"state\": \"failure\",\"context\": \"continuous-integration/jenkins\", \"description\": \"Jenkins\", \"target_url\": \"http://localhost:9090/job/spring-petclinic/$BUILD_NUMBER/console\"}"'
|
||||
}
|
||||
changed {
|
||||
echo 'Things were different before...'
|
||||
}
|
||||
}
|
||||
}
|
||||
pipeline { agent any
|
||||
stages { stage('Build') {
|
||||
steps {
|
||||
sh './mvnw package'
|
||||
} }
|
||||
} }
|
Loading…
Reference in a new issue