mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 23:05:49 +00:00
added docker stage
This commit is contained in:
parent
e660614717
commit
8bafe17be3
1 changed files with 4 additions and 2 deletions
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
|
@ -8,6 +8,8 @@ pipeline {
|
||||||
|
|
||||||
environment {
|
environment {
|
||||||
SONAR_AUTH_TOKEN = credentials('SONAR_AUTH_TOKEN') // Assumes you have stored your token in Jenkins Credentials
|
SONAR_AUTH_TOKEN = credentials('SONAR_AUTH_TOKEN') // Assumes you have stored your token in Jenkins Credentials
|
||||||
|
DOCKER_REGISTRY_CREDENTIALS = credentials('prasannakumarsinganamalla431/****** (dockerhub)')
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,11 +59,11 @@ pipeline {
|
||||||
sh 'mvn clean package -DskipTests'
|
sh 'mvn clean package -DskipTests'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build & push Docker Image') {
|
stage('Building Docker Image') {
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
withDockerRegistry('Docker') {
|
withDockerRegistry(credentialsId: 'DOCKER_REGISTRY_CREDENTIALS',registryUrl: "https://hub.docker.com/") {
|
||||||
sh "docker build -t prasannakumarsinganamalla431/petclinic:${BUILD_NUMBER} ."
|
sh "docker build -t prasannakumarsinganamalla431/petclinic:${BUILD_NUMBER} ."
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue