HBASE-12944 Support patches to branches in precommit jenkins build (ADDENDUM to fix the script)

This commit is contained in:
Enis Soztutar 2015-01-29 15:07:58 -08:00
parent a7816d88bd
commit 3931910460
1 changed files with 21 additions and 7 deletions

View File

@ -201,13 +201,6 @@ checkout () {
fi fi
fi fi
echo echo
else
if [[ $BRANCH_NAME -ne "master" ]]; then
echo "${GIT} checkout ${BRANCH_NAME}"
${GIT} checkout ${BRANCH_NAME}
echo "${GIT} status"
${GIT} status
fi
fi fi
return $? return $?
} }
@ -223,6 +216,26 @@ findBranchNameFromPatchName() {
return 0 return 0
} }
checkoutBranch() {
echo ""
echo ""
echo "======================================================================"
echo "======================================================================"
echo " Testing patch on branch ${BRANCH_NAME}."
echo "======================================================================"
echo "======================================================================"
echo ""
echo ""
if [[ $JENKINS == "true" ]] ; then
if [[ $BRANCH_NAME -ne "master" ]]; then
echo "${GIT} checkout ${BRANCH_NAME}"
${GIT} checkout ${BRANCH_NAME}
echo "${GIT} status"
${GIT} status
fi
fi
}
############################################################################### ###############################################################################
setup () { setup () {
### Download latest patch file (ignoring .htm and .html) when run from patch process ### Download latest patch file (ignoring .htm and .html) when run from patch process
@ -247,6 +260,7 @@ setup () {
$WGET -q -O $PATCH_DIR/patch $patchURL $WGET -q -O $PATCH_DIR/patch $patchURL
VERSION=${GIT_COMMIT}_${defect}_PATCH-${patchNum} VERSION=${GIT_COMMIT}_${defect}_PATCH-${patchNum}
findBranchNameFromPatchName ${relativePatchURL} findBranchNameFromPatchName ${relativePatchURL}
checkoutBranch
JIRA_COMMENT="Here are the results of testing the latest attachment JIRA_COMMENT="Here are the results of testing the latest attachment
$patchURL $patchURL
against ${BRANCH_NAME} branch at commit ${GIT_COMMIT}. against ${BRANCH_NAME} branch at commit ${GIT_COMMIT}.