Update Jenkinsfile

This commit is contained in:
Brady-Malott 2023-02-26 19:03:39 -05:00 committed by GitHub
parent 1fa6354773
commit 3d788eb83b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

4
Jenkinsfile vendored
View File

@ -9,8 +9,8 @@ pipeline {
}
stage('Deploy') {
steps {
// Stop running microblog container
sh 'docker stop $(docker ps -q --filter ancestor=microblog:latest) || true && docker rm $(docker ps -q --filter ancestor=microblog:latest) || true'
// Stop running microblog container (microblog label applied to microblog container by this repo's Dockerfile)
sh 'docker stop $(docker ps -q --filter label=microblog) || true && docker rm $(docker ps -q --filter label=microblog) || true'
// Deploy new container
sh 'docker run --name microblog -d -p 5000:5000 --rm microblog:latest'
// Remove all images except for jenkins