Skip to content

Commit

Permalink
Label environment images and prune more aggressively (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbovbel committed Jul 18, 2019
1 parent bf63309 commit 804c6e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Jenkinsfile
Expand Up @@ -23,6 +23,7 @@ pipeline {
string(name: 'num_to_keep', defaultValue: '10')
string(name: 'days_to_keep', defaultValue: '10')
string(name: 'docker_registry')
string(name: 'tailor_meta')
string(name: 'apt_repo')
booleanParam(name: 'deploy', defaultValue: false)
}
Expand Down Expand Up @@ -114,9 +115,9 @@ pipeline {
junit(testResults: 'tailor-image/test-results.xml')
}
cleanup {
library("tailor-meta@${params.tailor_meta}")
cleanDocker()
deleteDir()
// If two docker prunes run simultaneously, one will fail, hence || true
sh('docker image prune -af --filter="until=24h" --filter="label=tailor" || true')
}
}
}
Expand Down Expand Up @@ -156,8 +157,9 @@ pipeline {
}
}
} finally {
library("tailor-meta@${params.tailor_meta}")
cleanDocker()
deleteDir()
sh 'docker image prune -af --filter="until=24h" --filter="label=tailor" || true'
}
}}]
}
Expand Down
2 changes: 1 addition & 1 deletion environment/Dockerfile
@@ -1,6 +1,6 @@
FROM ubuntu:bionic

LABEL tailor="builder"
LABEL tailor="environment"

ARG AWS_ACCESS_KEY_ID
ENV AWS_ACCESS_KEY_ID ${AWS_ACCESS_KEY_ID}
Expand Down

0 comments on commit 804c6e7

Please sign in to comment.