mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-26 01:15:50 +00:00
initial Jenkinsfile
This commit is contained in:
parent
0e2cec00a4
commit
6e4d8661ee
1 changed files with 51 additions and 0 deletions
51
Jenkinsfile
vendored
Normal file
51
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
|
||||||
|
triggers {
|
||||||
|
pollSCM '*/5 * * * *'
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Checkstyle') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
./mvnw checkstyle:checkstyle
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Test') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
./mvnw test
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
./mvnw clean package
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Docker up') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
docker build -t "gavetisyangd/main:${GIT_COMMIT}" ./
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Push') {
|
||||||
|
steps {
|
||||||
|
withCredentials([string(credentialsId: 'dhub', variable: 'TOKEN')]) {
|
||||||
|
sh '''
|
||||||
|
echo $TOKEN | docker login -u gavetisyangd --password-stdin
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue