Skip to content

Commit

Permalink
Merge pull request #138 from Nohit-Java17/develop
Browse files Browse the repository at this point in the history
update pipeline
  • Loading branch information
Tynab authored Aug 2, 2023
2 parents 10d3010 + 97d3049 commit 426eb45
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ pipeline {
stages {
stage('Build') {
steps {
sh 'docker build -t ecommerce:latest .'
sh 'docker build -t yamiannephilim/ecommerce:latest .'
}
}

stage('Pushing') {
steps {
withDockerRegistry(credentialsId: 'dockerhub', url: 'https://index.docker.io/v1/') {
sh 'docker push yamiannephilim/springboot'
}
}
}

Expand All @@ -22,8 +30,17 @@ pipeline {

stage('Run') {
steps {
sh 'docker run --name ecommerce --network yan --restart=unless-stopped -d ecommerce:latest'
sh 'docker container stop ecommerce || echo "this container does not exist"'
sh 'docker network create yan || echo "this network exist"'
sh 'echo y | docker container prune'
sh 'docker run --name ecommerce --network yan --restart=unless-stopped -d yamiannephilim/ecommerce:latest'
}
}
}

post {
always {
cleanWs()
}
}
}

0 comments on commit 426eb45

Please sign in to comment.