From 804c6e72379a2dd2e54a923153925902109c99d3 Mon Sep 17 00:00:00 2001 From: Paul Bovbel Date: Thu, 18 Jul 2019 15:36:01 -0400 Subject: [PATCH] Label environment images and prune more aggressively (#26) --- Jenkinsfile | 8 +++++--- environment/Dockerfile | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 064a9d9..10f884c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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) } @@ -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') } } } @@ -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' } }}] } diff --git a/environment/Dockerfile b/environment/Dockerfile index cd6f006..d19a262 100644 --- a/environment/Dockerfile +++ b/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}