Skip to content

Commit

Permalink
update pipeline
Browse files Browse the repository at this point in the history
Co-authored-by: tiendat-NTD <[email protected]>
Co-authored-by: macmie2411999 <[email protected]>
  • Loading branch information
3 people committed Aug 2, 2023
1 parent 633e17e commit 97d3049
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 97d3049

Please sign in to comment.