xref: /Lucene/dev-tools/test-patch/jenkins-precommit-script.sh (revision 63fde153d3ca195f07a7fc2cc5999327411f3cc5)
112372530SSteve Rowe# Licensed to the Apache Software Foundation (ASF) under one or more
212372530SSteve Rowe# contributor license agreements.  See the NOTICE file distributed with
312372530SSteve Rowe# this work for additional information regarding copyright ownership.
412372530SSteve Rowe# The ASF licenses this file to You under the Apache License, Version 2.0
512372530SSteve Rowe# (the "License"); you may not use this file except in compliance with
612372530SSteve Rowe# the License.  You may obtain a copy of the License at
712372530SSteve Rowe#
812372530SSteve Rowe#     http://www.apache.org/licenses/LICENSE-2.0
912372530SSteve Rowe#
1012372530SSteve Rowe# Unless required by applicable law or agreed to in writing, software
1112372530SSteve Rowe# distributed under the License is distributed on an "AS IS" BASIS,
1212372530SSteve Rowe# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1312372530SSteve Rowe# See the License for the specific language governing permissions and
1412372530SSteve Rowe# limitations under the License.
1512372530SSteve Rowe#
1612372530SSteve Rowe# ----------------------------------------------------------------------------------
1712372530SSteve Rowe#
1812372530SSteve Rowe# This script is a copy of the one used by ASF Jenkins's PreCommit-LUCENE-Build job.
1912372530SSteve Rowe#
2012372530SSteve Rowe# See the script "test-patch.sh" in this directory for the script to use for
2112372530SSteve Rowe# local manual patch validation.
2212372530SSteve Rowe#
2312372530SSteve Rowe# For other examples of scripts used to invoke Yetus, see the configuration on the
2412372530SSteve Rowe# PreCommit jobs on ASF Jenkins: https://builds.apache.org/view/PreCommit+Builds/
2512372530SSteve Rowe#
2612372530SSteve Rowe# ------------>8-------------------------->8-------------------------->8------------
2712372530SSteve Rowe
2812372530SSteve Rowe#!/usr/bin/env bash
2912372530SSteve Rowe
3012372530SSteve Rowe# This is a modified copy of the script from Jenkins project "PreCommit-HADOOP-Build"
3112372530SSteve Rowe
3212372530SSteve RoweYETUSDIR=${WORKSPACE}/yetus
3312372530SSteve RoweTESTPATCHBIN=${YETUSDIR}/precommit/test-patch.sh
34*63fde153SSteve RoweARTIFACTS_SUBDIR=out
35*63fde153SSteve RoweARTIFACTS=${WORKSPACE}/${ARTIFACTS_SUBDIR}
3612372530SSteve RoweBASEDIR=${WORKSPACE}/sourcedir
3712372530SSteve Rowerm -rf "${ARTIFACTS}"
3812372530SSteve Rowemkdir -p "${ARTIFACTS}"
3912372530SSteve Rowe
40*63fde153SSteve RowePIDMAX=10000 # Arbitrary limit; may need to revisit
4112372530SSteve Rowe
4212372530SSteve RoweYETUS_RELEASE=0.7.0
4312372530SSteve RoweYETUS_TARBALL="yetus-${YETUS_RELEASE}.tar.gz"
4412372530SSteve Roweecho "Downloading Yetus ${YETUS_RELEASE}"
4512372530SSteve Rowecurl -L "https://api.github.com/repos/apache/yetus/tarball/rel/${YETUS_RELEASE}" -o "${YETUS_TARBALL}"
4612372530SSteve Rowerm -rf "${YETUSDIR}"
4712372530SSteve Rowemkdir -p "${YETUSDIR}"
4812372530SSteve Rowegunzip -c "${YETUS_TARBALL}" | tar xpf - -C "${YETUSDIR}" --strip-components 1
4912372530SSteve Rowe
5012372530SSteve RoweYETUS_ARGS+=("--project=LUCENE")
5112372530SSteve RoweYETUS_ARGS+=("--basedir=${BASEDIR}")
5212372530SSteve RoweYETUS_ARGS+=("--patch-dir=${ARTIFACTS}")
53*63fde153SSteve RoweYETUS_ARGS+=("--build-url-artifacts=artifact/${ARTIFACTS_SUBDIR}")
5412372530SSteve RoweYETUS_ARGS+=("--personality=${BASEDIR}/dev-tools/test-patch/lucene-solr-yetus-personality.sh")
5512372530SSteve RoweYETUS_ARGS+=("--jira-user=lucenesolrqa")
5612372530SSteve RoweYETUS_ARGS+=("--jira-password=$JIRA_PASSWORD")
5712372530SSteve RoweYETUS_ARGS+=("--brief-report-file=${ARTIFACTS}/email-report.txt")
5812372530SSteve RoweYETUS_ARGS+=("--console-report-file=${ARTIFACTS}/console-report.txt")
5912372530SSteve RoweYETUS_ARGS+=("--html-report-file=${ARTIFACTS}/console-report.html")
6012372530SSteve RoweYETUS_ARGS+=("--proclimit=${PIDMAX}")
6112372530SSteve RoweYETUS_ARGS+=("--console-urls")
6212372530SSteve RoweYETUS_ARGS+=("--debug")
6312372530SSteve RoweYETUS_ARGS+=("--skip-dirs=dev-tools")
6412372530SSteve RoweYETUS_ARGS+=("--bugcomments=jira")
6512372530SSteve RoweYETUS_ARGS+=("--resetrepo")
6612372530SSteve RoweYETUS_ARGS+=("--run-tests")
6712372530SSteve RoweYETUS_ARGS+=("--contrib-guide=https://wiki.apache.org/lucene-java/HowToContribute#Contributing_your_work")
6812372530SSteve RoweYETUS_ARGS+=("--jenkins")
6912372530SSteve RoweYETUS_ARGS+=("LUCENE-${ISSUE_NUM}")
7012372530SSteve Rowe
7112372530SSteve Rowe/bin/bash ${TESTPATCHBIN} "${YETUS_ARGS[@]}"
72