Skip to content

Commit

Permalink
Update Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Tal Yitzhak authored Mar 29, 2020
1 parent d3f7c51 commit 47390ad
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,33 @@ pipeline {
//if the code is compiled, we test and package it in its distributable format; run IT and store in local repository
}
}
stage('Building Image') {
steps{
script {
dockerImage = docker.build registry + ":latest"

stage ('Build docker image') {
steps {
script {
docker.build('http://localhost:8082/artifactory/docker/spring-petclinic-hub:latest', 'docker')
}
}
}
}
stage('Deploy Image') {
steps{
script {
docker.withRegistry( '', registryCredential ) {
dockerImage.push()
}

stage ('Push image to Artifactory') {
steps {
rtDockerPush(
serverId: "tal-local-arti",
image: 'http://localhost:8082/artifactory/docker' + '/spring-petclinic-hub:latest',
host: "http://172.17.0.3:8080",
targetRepo: 'docker',
properties: 'project-name=docker1;status=stable'
)
}
}
}
stage('Remove Unused docker image') {
steps{
sh "docker rmi $registry:latest"
}

stage ('Publish build info') {
steps {
rtPublishBuildInfo (
serverId: "tal-local-arti"
)
}
}
}
}
}

0 comments on commit 47390ad

Please sign in to comment.