Update Jenkinsfile

This commit is contained in:
Brady-Malott 2023-02-17 18:11:55 -05:00 committed by GitHub
parent bb4f23e397
commit 630fb4ca2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

3
Jenkinsfile vendored
View File

@ -10,7 +10,8 @@ pipeline {
stage('Deploy') { stage('Deploy') {
steps { steps {
// Stop running microblog container // Stop running microblog container
sh 'if [[ $(docker ps -q --filter ancestor=microblog:latest | wc -l) != 0 ]]; then docker stop $(docker ps -q --filter ancestor=microblog:latest) fi' //sh 'if [[ $(docker ps -q --filter ancestor=microblog:latest | wc -l) != 0 ]]; then docker stop $(docker ps -q --filter ancestor=microblog:latest) fi'
sh 'docker stop $(docker ps -q --filter ancestor=microblog:latest) || true && docker rm $(docker ps -q --filter ancestor=microblog:latest) || true'
// Deploy new container // Deploy new container
sh 'docker run -d -p 5000:5000 microblog:latest' sh 'docker run -d -p 5000:5000 microblog:latest'
} }