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 47390ad commit 029e3b1
Showing 1 changed file with 16 additions and 23 deletions.
39 changes: 16 additions & 23 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,26 @@ pipeline {
//if the code is compiled, we test and package it in its distributable format; run IT and store in local repository
}
}

stage ('Build docker image') {
steps {
script {
docker.build('http://localhost:8082/artifactory/docker/spring-petclinic-hub:latest', 'docker')
}
stage('Building Image') {
steps{
script {
dockerImage = docker.build registry + ":latest"
}
}
}

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('Deploy Image') {
steps{
script {
docker.withRegistry( '', registryCredential ) {
dockerImage.push()
}
}
}
}

stage ('Publish build info') {
steps {
rtPublishBuildInfo (
serverId: "tal-local-arti"
)
}
stage('Remove Unused docker image') {
steps{
sh "docker rmi $registry:latest"
}
}
}
}

0 comments on commit 029e3b1

Please sign in to comment.