Skip to content

Commit 804c6e7

Browse files
authored
Label environment images and prune more aggressively (#26)
1 parent bf63309 commit 804c6e7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Jenkinsfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pipeline {
2323
string(name: 'num_to_keep', defaultValue: '10')
2424
string(name: 'days_to_keep', defaultValue: '10')
2525
string(name: 'docker_registry')
26+
string(name: 'tailor_meta')
2627
string(name: 'apt_repo')
2728
booleanParam(name: 'deploy', defaultValue: false)
2829
}
@@ -114,9 +115,9 @@ pipeline {
114115
junit(testResults: 'tailor-image/test-results.xml')
115116
}
116117
cleanup {
118+
library("tailor-meta@${params.tailor_meta}")
119+
cleanDocker()
117120
deleteDir()
118-
// If two docker prunes run simultaneously, one will fail, hence || true
119-
sh('docker image prune -af --filter="until=24h" --filter="label=tailor" || true')
120121
}
121122
}
122123
}
@@ -156,8 +157,9 @@ pipeline {
156157
}
157158
}
158159
} finally {
160+
library("tailor-meta@${params.tailor_meta}")
161+
cleanDocker()
159162
deleteDir()
160-
sh 'docker image prune -af --filter="until=24h" --filter="label=tailor" || true'
161163
}
162164
}}]
163165
}

environment/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ubuntu:bionic
22

3-
LABEL tailor="builder"
3+
LABEL tailor="environment"
44

55
ARG AWS_ACCESS_KEY_ID
66
ENV AWS_ACCESS_KEY_ID ${AWS_ACCESS_KEY_ID}

0 commit comments

Comments
 (0)