mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-22 15:55:49 +00:00
Update Jenkinsfile
This commit is contained in:
parent
68fc95af0f
commit
325de083f3
1 changed files with 3 additions and 55 deletions
58
Jenkinsfile
vendored
58
Jenkinsfile
vendored
|
@ -1,55 +1,3 @@
|
||||||
if(env.CHANGE_ID != null){
|
@Library('pipeline_lib')
|
||||||
pipeline{
|
|
||||||
agent any
|
run()
|
||||||
stages {
|
|
||||||
stage ("build") {
|
|
||||||
steps {
|
|
||||||
echo "Running build automation..."
|
|
||||||
sh './mvnw checkstyle:checkstyle'
|
|
||||||
sh './mvnw verify'
|
|
||||||
sh './mvnw clean package -DskipTests=true'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage ("Build Docker Image") {
|
|
||||||
steps {
|
|
||||||
script{
|
|
||||||
app = docker.build("surtexx/mr:${GIT_COMMIT[0..7]}", "-f Dockerfile1 .")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage ("Push Docker Image") {
|
|
||||||
steps {
|
|
||||||
script{
|
|
||||||
docker.withRegistry('https://registry.hub.docker.com', 'docker_hub_login') {
|
|
||||||
app.push("${GIT_COMMIT[0..7]}")
|
|
||||||
app.push("latest")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(env.BRANCH_NAME == "main"){
|
|
||||||
pipeline{
|
|
||||||
agent any
|
|
||||||
stages{
|
|
||||||
stage ("Build Docker Image") {
|
|
||||||
steps {
|
|
||||||
script{
|
|
||||||
app = docker.build("surtexx/main", "-f Dockerfile1 .")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage ("Push Docker Image") {
|
|
||||||
steps {
|
|
||||||
script{
|
|
||||||
docker.withRegistry('https://registry.hub.docker.com', 'docker_hub_login') {
|
|
||||||
app.push("latest")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue