I am a little worried about jenkins losing this script every once in a while I'll paste it here:
set -e set -x ROOT=$PWD BRANCH=trunk export JIRA_ROOT_URL="https://issues.apache.org" export MAVEN_HOME=$(readlink -f /home/hudson/tools/maven/latest/) export JAVA_HOME=$(readlink -f /home/hudson/tools/java/latest1.6/) export PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH export MAVEN_OPTS="-Dmaven.repo.local=$ROOT/hive/build/mvn-repo/" export JIRA_NAME="HIVE-${ISSUE_NUM}" ### The following is a hack since this is not yet checked in test -d hive/build/ || mkdir hive/build/ cd hive/build/ if [[ -d ptest2 ]] then cd ptest2 git fetch origin git merge --ff-only origin/HIVE-4815 else git clone https://github.com/brockn/hive.git ptest2 cd ptest2 git checkout -b HIVE-4815 origin/HIVE-4815 fi cd testutils/ptest2/ ## end hack # process the jira JIRA_TEXT=$(mktemp) trap "rm -f $JIRA_TEXT" EXIT curl -s -S "${JIRA_ROOT_URL}/jira/browse/${JIRA_NAME}" > $JIRA_TEXT # ensure the patch is actually in the correct state if ! grep -q 'Patch Available' $JIRA_TEXT then echo "$JIRA_NAME is not \"Patch Available\". Exiting." exit 1 fi # pull attachments from JIRA (hack stolen from hadoop since rest api doesn't show attachements) PATCH_URL=$(grep -o '"/jira/secure/attachment/[0-9]*/[^"]*' $JIRA_TEXT | \ grep -v -e 'htm[l]*$' | sort | tail -1 | \ grep -o '/jira/secure/attachment/[0-9]*/[^"]*') if [[ -z "$PATCH_URL" ]] then echo "Unable to find attachment for $JIRA_NAME" exit 1 fi # validate the patch name, parse branch if needed shopt -s nocasematch if [[ $(basename $PATCH_URL) =~ ^HIVE-[0-9]+(-[a-z0-9-]+)?\.(patch|patch.\txt)$ ]] then echo ${BASH_REMATCH[@]} if [[ -n "${BASH_REMATCH[1]}" ]] then BRANCH=${BASH_REMATCH[1]#-} fi else echo "URL $(basename $PATCH_URL) does not appear to be a patch" exit 1 fi # append mr1 if needed if [[ $BRANCH =~ (mr1|mr2)$ ]] then profile=$BRANCH else profile=${BRANCH}-mr1 fi shopt -u nocasematch # sanity check the profile case "$profile" in trunk-mr1);; trunk-mr2);; *) echo "Unknown profile '$profile'" exit 1 esac mvn clean package -DskipTests set +e java -cp "target/hive-ptest-1.0-classes.jar:target/lib/*" org.apache.hive.ptest.api.client.PTestClient --endpoint http://ec2-174-129-184-35.compute-1.amazonaws.com --command testStart --profile $profile --password asdasdasd --outputDir target/ --testHandle "${BUILD_TAG##jenkins-}" --patch "${JIRA_ROOT_URL}${PATCH_URL}" --jira "$JIRA_NAME" ret=$? cd target/ if [[ -f test-results.tar.gz ]] then tar zxf test-results.tar.gz -C $ROOT/hive/build/ fi exit $ret