mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 15:25:49 +00:00
Create Jenkinsfile
This commit is contained in:
parent
516722647a
commit
67470ea014
1 changed files with 40 additions and 0 deletions
40
Jenkinsfile
vendored
Normal file
40
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
pipeline {
|
||||||
|
agent mavenbuilder
|
||||||
|
stages {
|
||||||
|
stage ('Checkstyle') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
echo 'RUNNING CHECKSTYLES...'
|
||||||
|
sh 'mvn checkstyle:checkstyle'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage ('Test') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
echo 'RUNNING TESTS...'
|
||||||
|
sh 'mvn test'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage ('Build') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
echo 'BUILDING ARTIFACTS...'
|
||||||
|
sh 'mvn clean package'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage ('Containerisation') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
def dockerImage = docker.build("test-image1:${GIT_COMMIT[0..7]}", '.')
|
||||||
|
docker.withRegistry('https://hub.docker.com/repository/docker/rgeorgegrid/mr', 'docker_hub_login') {
|
||||||
|
dockerImage.push()
|
||||||
|
}
|
||||||
|
echo 'IMAGES BUILT AND PUSHED TO MR REGISTRY'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue