Skip to content

Commit e6c089b

Browse files
anmolnareolivelli
authored andcommitted
ZOOKEEPER-3896: Added cleanup bits to all ZK builds
Recently I noticed some weird null pointer exception issues during compile in out new builds. I usually resolve this by a full "git clean" locally, so I added it to the Jenkinsfiles too. Author: Andor Molnar <[email protected]> Reviewers: Enrico Olivelli <[email protected]> Closes apache#1431 from anmolnar/ZOOKEEPER-3896
1 parent 0b386e4 commit e6c089b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Jenkinsfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,24 @@ pipeline {
5252
stage('BuildAndTest') {
5353
steps {
5454
git 'https://github.com/apache/zookeeper'
55+
sh "git clean -fxd"
5556
sh "mvn verify spotbugs:check checkstyle:check -Pfull-build -Dsurefire-forkcount=4"
5657
}
5758
post {
5859
always {
5960
junit '**/target/surefire-reports/TEST-*.xml'
6061
archiveArtifacts '**/target/*.jar'
6162
}
63+
// Jenkins pipeline jobs fill slaves on PRs without this :(
64+
cleanup() {
65+
script {
66+
sh label: 'Cleanup workspace', script: '''
67+
# See HADOOP-13951
68+
chmod -R u+rxw "${WORKSPACE}"
69+
'''
70+
deleteDir()
71+
}
72+
}
6273
}
6374
}
6475
}

Jenkinsfile-PreCommit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pipeline {
3737
stage('BuildAndTest') {
3838
steps {
3939
git 'https://github.com/apache/zookeeper'
40+
sh "git clean -fxd"
4041
sh "mvn verify spotbugs:check checkstyle:check -Pfull-build -Dsurefire-forkcount=4"
4142
}
4243
post {

0 commit comments

Comments
 (0)