cnauroth commented on code in PR #3841: URL: https://github.com/apache/hive/pull/3841#discussion_r1043699725
########## Jenkinsfile: ########## @@ -0,0 +1,219 @@ +/* + * 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. + */ + +properties([ + // max 5 build/branch/day + rateLimitBuilds(throttle: [count: 5, durationName: 'day', userBoost: true]), + // do not run multiple testruns on the same branch + disableConcurrentBuilds(), + parameters([ + string(name: 'SPLIT', defaultValue: '20', description: 'Number of buckets to split tests into.'), + string(name: 'OPTS', defaultValue: '', description: 'additional maven opts'), + ]) +]) + +this.prHead = null; +def checkPrHead() { + if(env.CHANGE_ID) { + println("checkPrHead - prHead:" + prHead) + println("checkPrHead - prHead2:" + pullRequest.head) + if (prHead == null) { + prHead = pullRequest.head; + } else { + if(prHead != pullRequest.head) { + currentBuild.result = 'ABORTED' + error('Found new changes on PR; aborting current build') + } + } + } +} +checkPrHead() + +def setPrLabel(String prLabel) { + if (env.CHANGE_ID) { + def mapping=[ + "SUCCESS":"tests passed", + "UNSTABLE":"tests unstable", + "FAILURE":"tests failed", + "PENDING":"tests pending", + ] + def newLabels = [] + for( String l : pullRequest.labels ) + newLabels.add(l) + for( String l : mapping.keySet() ) + newLabels.remove(mapping[l]) + newLabels.add(mapping[prLabel]) + echo ('' +newLabels) + pullRequest.labels=newLabels + } +} + +setPrLabel("PENDING"); + +def executorNode(run) { + hdbPodTemplate { + timeout(time: 24, unit: 'HOURS') { + node(POD_LABEL) { + container('hdb') { + run() + } + } + } + } +} + +def buildHive(args) { + configFileProvider([configFile(fileId: 'artifactory', variable: 'SETTINGS')]) { + withEnv(["MULTIPLIER=$params.MULTIPLIER","M_OPTS=$params.OPTS"]) { + sh '''#!/bin/bash -e +ls -l +set -x +. /etc/profile.d/confs.sh +export USER="`whoami`" +export MAVEN_OPTS="-Xmx2g" +export -n HIVE_CONF_DIR +cp $SETTINGS .git/settings.xml +OPTS=" -s $PWD/.git/settings.xml -B -Dtest.groups= " +OPTS+=" -Pitests,qsplits,dist" Review Comment: Sorry, this was my mistake, looking at a bad local checkout of branch-3. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
