HBASE-14337 Improve test-patch to better deal with dependency licenses

* if we know we're going to fail the build via velocity template failure, output the cause in the generated LICENSE file.
* tweak test-patch workspace handling to allow for checkout of repo next to patch process
This commit is contained in:
Sean Busbey 2015-08-31 08:52:12 -05:00
parent 3aa2b2d638
commit a5261b6f44
2 changed files with 17 additions and 4 deletions

View File

@ -35,6 +35,7 @@ NEWLINE=$'\n'
PROJECT_NAME=HBase
JENKINS=false
MOVE_PATCH_DIR=true
PATCH_DIR=/tmp
BASEDIR=$(pwd)
BRANCH_NAME="master"
@ -90,6 +91,9 @@ parseArgs() {
--jenkins)
JENKINS=true
;;
--no-move-patch-dir)
MOVE_PATCH_DIR=false
;;
--patch-dir=*)
PATCH_DIR=${i#*=}
;;
@ -1001,8 +1005,9 @@ $comment"
### Cleanup files
cleanupAndExit () {
local result=$1
if [[ $JENKINS == "true" ]] ; then
if [[ ${JENKINS} == "true" && ${MOVE_PATCH_DIR} == "true" ]] ; then
if [ -e "$PATCH_DIR" ] ; then
echo "Relocating patch dir into ${BASEDIR}"
mv $PATCH_DIR $BASEDIR
fi
fi

View File

@ -1560,13 +1560,21 @@ You can redistribute it and/or modify it under either the terms of the GPL
#set($hadoop = false)
## include LICENSE sections for anything not under ASL2.0
#foreach( ${dep} in ${projects} )
## if there are no licenses we'll fail the build later, so
## make sure we output something now that can be used to triage.
#if(${dep.licenses.size()} == 0)
No license info included; must update supplemental-models for:
g:${dep.groupId} AND a:${dep.artifactId} AND v:${dep.version}
Until hbase-resource-bundle/src/main/resources/supplemental-models.xml
is updated, the build should fail.
#end
#if(${debug-print-included-work-info.equalsIgnoreCase("true")})
=====
Check license for included work
#if(${dep.licenses.size()} == 0)
No license info included; must update supplemental-models
#else
#if(${dep.licenses.size()} > 0)
License short name: '${dep.licenses[0].name}'
#end