Skip to content

Commit cdc9317

Browse files
committed
Jenkinsfile: use buildDiscarder to keep only last 500 builds
1 parent 699efcc commit cdc9317

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Jenkinsfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
// dev branch only: every 30 minutes at night (1:00 - 5:00)
22
String cronSchedule = BRANCH_NAME == 'dev' ? '*/30 1-5 * * *' : ''
3+
String buildsToKeep = '500'
34

45
// https://jenkins.io/doc/book/pipeline/syntax/
56
pipeline {
67
agent any
78

9+
options {
10+
buildDiscarder(logRotator(numToKeepStr: buildsToKeep, artifactNumToKeepStr: buildsToKeep))
11+
}
12+
813
triggers {
914
upstream(upstreamProjects: "ObjectStore-Linux/${env.BRANCH_NAME.replaceAll("/", "%2F")}",
1015
threshold: hudson.model.Result.SUCCESS)

0 commit comments

Comments
 (0)