[ https://issues.apache.org/jira/browse/ZOOKEEPER-2624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15633354#comment-15633354 ]
ASF GitHub Bot commented on ZOOKEEPER-2624: ------------------------------------------- Github user hanm commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/97#discussion_r86386121 --- Diff: src/java/test/bin/test-github-pr.sh --- @@ -0,0 +1,607 @@ +#!/usr/bin/env bash +# Licensed 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. + + +#set -x + +### Setup some variables. +### GIT_COMMIT and BUILD_URL are set by Hudson if it is run by patch process +### Read variables from properties file +. `dirname $0`/test-patch.properties + +############################################################################### +parseArgs() { + case "$1" in + QABUILD) + ### Set QABUILD to true to indicate that this script is being run by Hudson + QABUILD=true + if [[ $# != 14 ]] ; then + echo "ERROR: usage $0 QABUILD <PATCH_DIR> <PS_CMD> <WGET_CMD> <JIRACLI> <GIT_CMD> <GREP_CMD> <PATCH_CMD> <FINDBUGS_HOME> <FORREST_HOME> <WORKSPACE_BASEDIR> <JIRA_PASSWD> <JAVA5_HOME> <CURL_CMD>" + cleanupAndExit 0 + fi + PATCH_DIR=$2 + PS=$3 + WGET=$4 + JIRACLI=$5 + GIT=$6 + GREP=$7 + PATCH=$8 + FINDBUGS_HOME=$9 + FORREST_HOME=${10} + BASEDIR=${11} + JIRA_PASSWD=${12} + JAVA5_HOME=${13} + CURL=${14} + if [ ! -e "$PATCH_DIR" ] ; then + mkdir -p $PATCH_DIR + fi + + ;; + DEVELOPER) + ### Set QABUILD to false to indicate that this script is being run by a developer + QABUILD=false + if [[ $# != 10 ]] ; then + echo "ERROR: usage $0 DEVELOPER <PATCH_FILE> <SCRATCH_DIR> <GIT_CMD> <GREP_CMD> <PATCH_CMD> <FINDBUGS_HOME> <FORREST_HOME> <WORKSPACE_BASEDIR> <JAVA5_HOME>" + cleanupAndExit 0 + fi + ### PATCH_FILE contains the location of the patchfile + PATCH_FILE=$2 + if [[ ! -e "$PATCH_FILE" ]] ; then + echo "Unable to locate the patch file $PATCH_FILE" + cleanupAndExit 0 + fi + PATCH_DIR=$3 + ### Check if $PATCH_DIR exists. If it does not exist, create a new directory + if [[ ! -e "$PATCH_DIR" ]] ; then + mkdir "$PATCH_DIR" + if [[ $? == 0 ]] ; then + echo "$PATCH_DIR has been created" + else + echo "Unable to create $PATCH_DIR" + cleanupAndExit 0 + fi + fi + GIT=$4 + GREP=$5 + PATCH=$6 + FINDBUGS_HOME=$7 + FORREST_HOME=$8 + BASEDIR=$9 + JAVA5_HOME=${10} + ### Obtain the patch filename to append it to the version number + defect=`basename $PATCH_FILE` --- End diff -- With git flow, I guess we don't care about the patch file name (e.g. ZOOKEEPER-1234.patch), so this could be removed? > Add test script for pull requests > --------------------------------- > > Key: ZOOKEEPER-2624 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2624 > Project: ZooKeeper > Issue Type: Improvement > Components: scripts > Reporter: Flavio Junqueira > Assignee: Flavio Junqueira > > We need a script similar to {{test-patch.sh}} to handle QA builds for pull > requests. -- This message was sent by Atlassian JIRA (v6.3.4#6332)