diff options
author | Andor Molnar <andor@apache.org> | 2020-07-29 11:37:21 +0200 |
---|---|---|
committer | Enrico Olivelli <eolivelli@apache.org> | 2020-07-29 11:37:21 +0200 |
commit | 2898ffddb05df4e826be34ad13478e78ad6fb321 (patch) | |
tree | 5852c73b6e2134ff7842d40a9e7bd2e21ad5ba9c /Jenkinsfile-PreCommit | |
parent | 6a8728d98307f7d52cf6dbadb78149e01b1d0bf5 (diff) | |
download | zookeeper-2898ffddb05df4e826be34ad13478e78ad6fb321.tar.gz |
ZOOKEEPER-3896: Added separate Jenkinsfile for PreCommit jobs + disable concurrent builds
Further improvements to our Jenkinsfiles.
Author: Andor Molnar <andor@apache.org>
Reviewers: Enrico Olivelli <eolivelli@apache.org>
Closes #1416 from anmolnar/ZOOKEEPER-3896
Diffstat (limited to 'Jenkinsfile-PreCommit')
-rw-r--r-- | Jenkinsfile-PreCommit | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Jenkinsfile-PreCommit b/Jenkinsfile-PreCommit new file mode 100644 index 000000000..d2a666b7b --- /dev/null +++ b/Jenkinsfile-PreCommit @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +pipeline { + agent { + label 'Hadoop' + } + + options { + disableConcurrentBuilds() + buildDiscarder(logRotator(daysToKeepStr: '14')) + timeout(time: 2, unit: 'HOURS') + timestamps() + } + + tools { + maven "Maven (latest)" + jdk "JDK 1.8 (latest)" + } + + stages { + stage('BuildAndTest') { + steps { + git 'https://github.com/apache/zookeeper' + sh "mvn verify spotbugs:check checkstyle:check -Pfull-build -Dsurefire-forkcount=4" + } + post { + always { + junit '**/target/surefire-reports/TEST-*.xml' + } + } + } + } + + post { + // Jenkins pipeline jobs fill slaves on PRs without this :( + cleanup() { + script { + sh label: 'Cleanup workspace', script: ''' + # See HADOOP-13951 + chmod -R u+rxw "${WORKSPACE}" + ''' + deleteDir() + } + } + } +} |