Jenkinsfile: Don't keep artifacts for old PR builds
parent
4df6d98988
commit
d54f880e5e
|
@ -1,5 +1,9 @@
|
||||||
#!/usr/bin/env groovy
|
#!/usr/bin/env groovy
|
||||||
properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '30', artifactNumToKeepStr: '10']]])
|
if (env.BRANCH_NAME.startsWith('PR-')) {
|
||||||
|
properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactNumToKeepStr: '1']]])
|
||||||
|
} else {
|
||||||
|
properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '30', artifactNumToKeepStr: '5']]])
|
||||||
|
}
|
||||||
|
|
||||||
node('master') {
|
node('master') {
|
||||||
stage('Pull changes') {
|
stage('Pull changes') {
|
||||||
|
@ -22,7 +26,7 @@ node('master') {
|
||||||
sh 'rm -f data.zip'
|
sh 'rm -f data.zip'
|
||||||
zip zipFile: 'data.zip', archive: true, dir: 'build/install'
|
zip zipFile: 'data.zip', archive: true, dir: 'build/install'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean workspace after building pull requests
|
// Clean workspace after building pull requests
|
||||||
// to save disk space on the Jenkins host
|
// to save disk space on the Jenkins host
|
||||||
if (env.BRANCH_NAME.startsWith('PR-')) {
|
if (env.BRANCH_NAME.startsWith('PR-')) {
|
||||||
|
|
Loading…
Reference in New Issue