xref: /Lucene/dev-tools/test-patch/jenkins-precommit-script.sh (revision 63fde153d3ca195f07a7fc2cc5999327411f3cc5)
1# Licensed to the Apache Software Foundation (ASF) under one or more
2# contributor license agreements.  See the NOTICE file distributed with
3# this work for additional information regarding copyright ownership.
4# The ASF licenses this file to You under the Apache License, Version 2.0
5# (the "License"); you may not use this file except in compliance with
6# the License.  You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16# ----------------------------------------------------------------------------------
17#
18# This script is a copy of the one used by ASF Jenkins's PreCommit-LUCENE-Build job.
19#
20# See the script "test-patch.sh" in this directory for the script to use for
21# local manual patch validation.
22#
23# For other examples of scripts used to invoke Yetus, see the configuration on the
24# PreCommit jobs on ASF Jenkins: https://builds.apache.org/view/PreCommit+Builds/
25#
26# ------------>8-------------------------->8-------------------------->8------------
27
28#!/usr/bin/env bash
29
30# This is a modified copy of the script from Jenkins project "PreCommit-HADOOP-Build"
31
32YETUSDIR=${WORKSPACE}/yetus
33TESTPATCHBIN=${YETUSDIR}/precommit/test-patch.sh
34ARTIFACTS_SUBDIR=out
35ARTIFACTS=${WORKSPACE}/${ARTIFACTS_SUBDIR}
36BASEDIR=${WORKSPACE}/sourcedir
37rm -rf "${ARTIFACTS}"
38mkdir -p "${ARTIFACTS}"
39
40PIDMAX=10000 # Arbitrary limit; may need to revisit
41
42YETUS_RELEASE=0.7.0
43YETUS_TARBALL="yetus-${YETUS_RELEASE}.tar.gz"
44echo "Downloading Yetus ${YETUS_RELEASE}"
45curl -L "https://api.github.com/repos/apache/yetus/tarball/rel/${YETUS_RELEASE}" -o "${YETUS_TARBALL}"
46rm -rf "${YETUSDIR}"
47mkdir -p "${YETUSDIR}"
48gunzip -c "${YETUS_TARBALL}" | tar xpf - -C "${YETUSDIR}" --strip-components 1
49
50YETUS_ARGS+=("--project=LUCENE")
51YETUS_ARGS+=("--basedir=${BASEDIR}")
52YETUS_ARGS+=("--patch-dir=${ARTIFACTS}")
53YETUS_ARGS+=("--build-url-artifacts=artifact/${ARTIFACTS_SUBDIR}")
54YETUS_ARGS+=("--personality=${BASEDIR}/dev-tools/test-patch/lucene-solr-yetus-personality.sh")
55YETUS_ARGS+=("--jira-user=lucenesolrqa")
56YETUS_ARGS+=("--jira-password=$JIRA_PASSWORD")
57YETUS_ARGS+=("--brief-report-file=${ARTIFACTS}/email-report.txt")
58YETUS_ARGS+=("--console-report-file=${ARTIFACTS}/console-report.txt")
59YETUS_ARGS+=("--html-report-file=${ARTIFACTS}/console-report.html")
60YETUS_ARGS+=("--proclimit=${PIDMAX}")
61YETUS_ARGS+=("--console-urls")
62YETUS_ARGS+=("--debug")
63YETUS_ARGS+=("--skip-dirs=dev-tools")
64YETUS_ARGS+=("--bugcomments=jira")
65YETUS_ARGS+=("--resetrepo")
66YETUS_ARGS+=("--run-tests")
67YETUS_ARGS+=("--contrib-guide=https://wiki.apache.org/lucene-java/HowToContribute#Contributing_your_work")
68YETUS_ARGS+=("--jenkins")
69YETUS_ARGS+=("LUCENE-${ISSUE_NUM}")
70
71/bin/bash ${TESTPATCHBIN} "${YETUS_ARGS[@]}"
72