You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by br...@apache.org on 2014/11/12 21:58:04 UTC

svn commit: r1639054 - in /hive/trunk/dev-support: jenkins-common.sh jenkins-execute-build.sh

Author: brock
Date: Wed Nov 12 20:58:04 2014
New Revision: 1639054

URL: http://svn.apache.org/r1639054
Log:
HIVE-8847 - Fix bugs in jenkins scripts (Brock reviewed by Szehon)

Modified:
    hive/trunk/dev-support/jenkins-common.sh
    hive/trunk/dev-support/jenkins-execute-build.sh

Modified: hive/trunk/dev-support/jenkins-common.sh
URL: http://svn.apache.org/viewvc/hive/trunk/dev-support/jenkins-common.sh?rev=1639054&r1=1639053&r2=1639054&view=diff
==============================================================================
--- hive/trunk/dev-support/jenkins-common.sh (original)
+++ hive/trunk/dev-support/jenkins-common.sh Wed Nov 12 20:58:04 2014
@@ -22,10 +22,11 @@ fail() {
 # Exports two variables of import:
 # * BUILD_PROFILE - the profile which the ptest server understands
 # * BUILD_OPTS - additional test options to be sent to ptest cli
+# * PATCH_URL - the URL to the patch file
 process_jira() {
   test -n "$BRANCH" || fail "BRANCH must be specified"
   test -n "$JIRA_ROOT_URL" || fail "JIRA_ROOT_URL must be specified"
-  test -n "$JIRA_NAME" || fail "API_PASSWORD must be specified"
+  test -n "$JIRA_NAME" || fail "JIRA_NAME must be specified"
   JIRA_TEXT=$(mktemp)
   trap "rm -f $JIRA_TEXT" EXIT
   curl -s -S --location --retry 3 "${JIRA_ROOT_URL}/jira/browse/${JIRA_NAME}" > $JIRA_TEXT
@@ -39,7 +40,7 @@ process_jira() {
     fail "$JIRA_NAME is not \"Patch Available\". Exiting."
   fi
   # pull attachments from JIRA (hack stolen from hadoop since rest api doesn't show attachments)
-  PATCH_URL=$(grep -o '"/jira/secure/attachment/[0-9]*/[^"]*' $JIRA_TEXT | \
+  export 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" ]]

Modified: hive/trunk/dev-support/jenkins-execute-build.sh
URL: http://svn.apache.org/viewvc/hive/trunk/dev-support/jenkins-execute-build.sh?rev=1639054&r1=1639053&r2=1639054&view=diff
==============================================================================
--- hive/trunk/dev-support/jenkins-execute-build.sh (original)
+++ hive/trunk/dev-support/jenkins-execute-build.sh Wed Nov 12 20:58:04 2014
@@ -19,15 +19,34 @@ test -n "$BRANCH" || fail "BRANCH must b
 test -n "$API_ENDPOINT" || fail "API_ENDPOINT must be specified"
 test -n "$LOG_ENDPOINT" || fail "LOG_ENDPOINT must be specified"
 test -n "$API_PASSWORD" || fail "API_PASSWORD must be specified"
-export JIRA_NAME="HIVE-${ISSUE_NUM}"
+if [[ -n "$ISSUE_NUM" ]]
+then
+  export JIRA_NAME="HIVE-${ISSUE_NUM}"
+fi
 export ROOT=$PWD
 export JIRA_ROOT_URL="https://issues.apache.org"
 export BUILD_TAG="${BUILD_TAG##jenkins-}"
-echo $JIRA_NAME
+if [[ -n "$JIRA_NAME" ]]
+then
+  echo $JIRA_NAME
+fi
 set -x
 env
 
-process_jira
+if [[ -n "$JIRA_NAME" ]]
+then
+  process_jira
+fi
+
+profile=$BUILD_PROFILE
+if [[ -z "$profile" ]]
+then
+  profile=$DEFAULT_BUILD_PROFILE
+fi
+if [[ -z "$profile" ]]
+then
+  fail "Could not find build profile"
+fi
 
 test -d hive/build/ || mkdir -p hive/build/
 cd hive/build/
@@ -35,17 +54,13 @@ rm -rf ptest2
 svn co http://svn.apache.org/repos/asf/hive/trunk/testutils/ptest2/ ptest2
 cd ptest2
 
-# sanity check the profile
-case "$BUILD_PROFILE" in
-  trunk-mr1);;
-  trunk-mr2);;
-  *)
-  echo "Unknown profile '$BUILD_PROFILE'"
-  exit 1
-  ;;
-esac
 mvn clean package -DskipTests -Drat.numUnapprovedLicenses=1000 -Dmaven.repo.local=$WORKSPACE/.m2
 set +e
+optionalArgs=()
+if [[ -n "$JIRA_NAME" ]]
+then
+  optionalArgs=(--patch "${JIRA_ROOT_URL}${PATCH_URL}" --jira "$JIRA_NAME")
+fi
 java -cp "target/hive-ptest-1.0-classes.jar:target/lib/*" org.apache.hive.ptest.api.client.PTestClient --endpoint "$API_ENDPOINT" \
   --logsEndpoint "$LOG_ENDPOINT" \
   --command testStart \
@@ -53,8 +68,7 @@ java -cp "target/hive-ptest-1.0-classes.
   --password $API_PASSWORD \
   --outputDir target/ \
   --testHandle "$BUILD_TAG" \
-  --patch "${JIRA_ROOT_URL}${PATCH_URL}" \
-  --jira "$JIRA_NAME" ${BUILD_OPTS} "$@"
+  ${optionalArgs[@]} ${BUILD_OPTS} "$@"
 ret=$?
 cd target/
 if [[ -f test-results.tar.gz ]]