Update Jenkinsfile

This commit is contained in:
Brady-Malott 2023-02-26 21:23:48 -05:00 committed by GitHub
parent 1edae19db2
commit ab761c89f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

4
Jenkinsfile vendored
View File

@ -6,6 +6,8 @@ pipeline {
steps { steps {
// Stop running microblog container (microblog label applied to microblog container by this repo's Dockerfile) // Stop running microblog container (microblog label applied to microblog container by this repo's Dockerfile)
sh 'docker stop $(docker ps -q --filter name=microblog) || true && docker rm $(docker ps -q --filter name=microblog) || true' sh 'docker stop $(docker ps -q --filter name=microblog) || true && docker rm $(docker ps -q --filter name=microblog) || true'
// Remove all images except for jenkins
sh 'docker image prune --filter "label!=org.opencontainers.image.vendor=Jenkins project"'
} }
} }
stage('Build') { stage('Build') {
@ -17,8 +19,6 @@ pipeline {
steps { steps {
// Deploy new container // Deploy new container
sh 'docker run --name microblog -d -p 5000:5000 --rm microblog:latest' sh 'docker run --name microblog -d -p 5000:5000 --rm microblog:latest'
// Remove all images except for jenkins
sh 'docker image prune --filter "label!=org.opencontainers.image.vendor=Jenkins project"'
} }
} }
stage('Selenium Tests') { stage('Selenium Tests') {