This is an automated email from the ASF dual-hosted git repository.
sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new 50f6736 ISSUE #323: [WEBSITE] ci job to automatically publish website
to apache once the pull request is merged
50f6736 is described below
commit 50f67361d5deea529d0af80a61e3312a8dd31e7e
Author: Sijie Guo <[email protected]>
AuthorDate: Mon Jul 31 14:45:57 2017 -0700
ISSUE #323: [WEBSITE] ci job to automatically publish website to apache
once the pull request is merged
Descriptions of the changes in this PR:
- add a Dockerfile to use ruby:2.4.1 to build website
- add scripts to run docker file interactively (run.sh) and in ci (ci.sh)
- also remove a few scripts that were not used by jenkins anymore.
Author: Sijie Guo <[email protected]>
Reviewers: Matteo Merli <[email protected]>
This closes #332 from sijie/sijie/jenkin_jobs, closes #323
---
bin/find-new-patch-available-jiras | 129 -------
bin/raw-check-patch | 47 ---
bin/test-patch | 416 ---------------------
bin/test-patch-00-clean | 100 -----
bin/test-patch-05-patch-raw-analysis | 165 --------
bin/test-patch-08-rat | 132 -------
bin/test-patch-09-javadoc | 118 ------
bin/test-patch-10-compile | 144 -------
bin/test-patch-11-findbugs | 156 --------
bin/test-patch-20-tests | 125 -------
bin/test-patch-30-dist | 106 ------
bin/update-master-docs | 44 ---
.../src/main/resources/ide/eclipse/formatter.xml | 0
patch-review.py | 228 -----------
site/docker/Dockerfile | 20 +
site/docker/ci.sh | 64 ++++
site/docker/run.sh | 76 ++++
17 files changed, 160 insertions(+), 1910 deletions(-)
diff --git a/bin/find-new-patch-available-jiras
b/bin/find-new-patch-available-jiras
deleted file mode 100755
index 1515495..0000000
--- a/bin/find-new-patch-available-jiras
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/bin/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.
-
-if [ "${TESTPATCHDEBUG}" == "true" ] ; then
- set -x
-fi
-
-BASEDIR=$(pwd)
-TEMPDIR=${BASEDIR}/tmp
-
-JIRAAVAILPATCHQUERY="https://issues.apache.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+in+%28BOOKKEEPER%29+AND+status+%3D+%22Patch+Available%22+ORDER+BY+updated+DESC&tempMax=1000"
-TESTPATCHJOBURL="https://builds.apache.org/job/bookkeeper-trunk-precommit-build"
-TOKEN=""
-SUBMIT="false"
-DELETEHISTORYFILE="false"
-
-RUNTESTSFILE=${BASEDIR}/TESTED_PATCHES.txt
-
-printUsage() {
- echo "Usage: $0 <OPTIONS>"
- echo " --submit --token=<BOOKKEEPER PRECOMMIT JOB TOKEN>"
- echo " [--delete-history-file]"
- echo " [--script-debug]"
- echo
-}
-###############################################################################
-parseArgs() {
- for i in $*
- do
- case $i in
- --submit)
- SUBMIT="true"
- ;;
- --token=*)
- TOKEN=${i#*=}
- ;;
- --script-debug)
- DEBUG="-x"
- ;;
- --delete-history-file)
- DELETEHISTORYFILE="true"
- ;;
- *)
- echo "Invalid option"
- echo
- printUsage
- exit 1
- ;;
- esac
- done
- if [[ "$SUBMIT" == "true" && "${TOKEN}" == "" ]] ; then
- echo "Token has not been specified"
- echo
- printUsage
- exit 1
- fi
-}
-
-###############################################################################
-findAndSubmitAvailablePatches() {
- ## Grab all the key (issue numbers) and largest attachment id for each
item in the XML
- curl --fail --location --retry 3 "${JIRAAVAILPATCHQUERY}" >
${TEMPDIR}/patch-availables.xml
- if [ "$?" != "0" ] ; then
- echo "Could not retrieve available patches from JIRA"
- exit 1
- fi
- xpath -e "//item/key/text() |
//item/attachments/attachment[not(../attachment/@id > @id)]/@id" \
- ${TEMPDIR}/patch-availables.xml > ${TEMPDIR}/patch-attachments.element
-
- ### Replace newlines with nothing, then replace id=" with =, then replace
" with newline
- ### to yield lines with pairs (issueNumber,largestAttachmentId). Example:
BOOKKEEPER-123,456984
- cat ${TEMPDIR}/patch-attachments.element \
- | awk '{ if ( $1 ~ /^BOOKKEEPER\-/) {JIRA=$1 }; if ($1 ~ /id=/) {
print JIRA","$1} }' \
- | sed 's/id\="//' | sed 's/"//' > ${TEMPDIR}/patch-availables.pair
-
- ### Iterate through issue list and find the
(issueNumber,largestAttachmentId) pairs that have
- ### not been tested (ie don't already exist in the patch_tested.txt file
- touch ${RUNTESTSFILE}
- cat ${TEMPDIR}/patch-availables.pair | while read PAIR ; do
- set +e
- COUNT=`grep -c "$PAIR" ${RUNTESTSFILE}`
- set -e
- if [ "$COUNT" -lt "1" ] ; then
- ### Parse $PAIR into project, issue number, and attachment id
- ISSUE=`echo $PAIR | sed -e "s/,.*$//"`
- echo "Found new patch for issue $ISSUE"
- if [ "$SUBMIT" == "true" ]; then
- ### Kick off job
- echo "Submitting job for issue $ISSUE"
- curl --fail --location --retry 3 \
-
"${TESTPATCHJOBURL}/buildWithParameters?token=${TOKEN}&JIRA_NUMBER=${ISSUE}" >
/dev/null
- if [ "$?" != "0" ] ; then
- echo "Could not submit precommit job for $ISSUE"
- exit 1
- fi
- fi
- ### Mark this pair as tested by appending to file
- echo "$PAIR" >> ${RUNTESTSFILE}
- fi
- done
-}
-###############################################################################
-
-mkdir -p ${TEMPDIR} 2>&1 $STDOUT
-
-parseArgs "$@"
-
-if [ -n "${DEBUG}" ] ; then
- set -x
-fi
-
-if [ "${DELETEHISTORYFILE}" == "true" ] ; then
- rm ${RUNTESTSFILE}
-fi
-
-findAndSubmitAvailablePatches
-
-exit 0
diff --git a/bin/raw-check-patch b/bin/raw-check-patch
deleted file mode 100644
index b3bfd01..0000000
--- a/bin/raw-check-patch
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/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.
-
-printTrailingSpaces() {
- PATCH=$1
- cat $PATCH | awk '/^+/ { if (/ $/) { print "\tL" NR ":" $0} }'
-}
-
-printTabs() {
- PATCH=$1
- cat $PATCH | awk '/^+/ { if (/\t/) { print "\tL" NR ":" $0 } }'
-}
-
-printAuthors() {
- PATCH=$1
- cat $PATCH | awk '/^+/ { L=tolower($0); if (L ~ /.*\*.* @author/) { print
"\tL" NR ":" $0 } }'
-}
-
-printLongLines() {
- PATCH=$1
- cat $PATCH | awk '/^+/ { if ( length > 121 ) { print "\tL" NR ":" $0 } }'
-}
-
-if [[ "X$(basename -- "$0")" = "Xraw-check-patch" ]]; then
- echo Trailing spaces
- printTrailingSpaces $1
- echo
- echo Tabs
- printTabs $1
- echo
- echo Authors
- printAuthors $1
- echo
- echo Long lines
- printLongLines $1
-fi
diff --git a/bin/test-patch b/bin/test-patch
deleted file mode 100755
index e81d653..0000000
--- a/bin/test-patch
+++ /dev/null
@@ -1,416 +0,0 @@
-#!/bin/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.
-
-if [ "${TESTPATCHDEBUG}" == "true" ] ; then
- set -x
-fi
-
-BASEDIR=$(pwd)
-TESTPATCHDIRNAME=test-patch
-TESTPATCHDIR=${BASEDIR}/${TESTPATCHDIRNAME}
-TOOLSDIR=${TESTPATCHDIR}/tools
-TEMPDIR=${TESTPATCHDIR}/tmp
-REPORTDIR=${TESTPATCHDIR}/reports
-SUMMARYFILE=${REPORTDIR}/TEST-SUMMARY.jira
-SUMMARYFILETXT=${REPORTDIR}/TEST-SUMMARY.txt
-
-JIRAHOST="https://issues.apache.org"
-JIRAURL="${JIRAHOST}/jira"
-JIRAURLISSUEPREFIX="${JIRAURL}/browse/"
-
-JIRAUPDATE="false"
-JIRAUSER=""
-JIRAPASSWORD=""
-
-
-VERBOSEOPTION=""
-JIRAISSUE=""
-PATCHFILE=""
-TASKSTORUN=""
-TASKSTOSKIP=""
-RESETSCM="false"
-DIRTYSCM="false"
-STDOUT="/dev/null"
-MVNPASSTHRU=""
-
-###############################################################################
-gitOrSvn() {
- SCM="NONE"
- which git &> /dev/null
- if [[ $? == 0 ]] ; then
- git status &> /dev/null
- if [[ $? == 0 ]] ; then
- SCM="git"
- fi
- fi
- if [ "${SCM}" == "NONE" ] ; then
- which svn &> /dev/null
- if [[ $? == 0 ]] ; then
- svnOutput=`svn status 2>&1`
- if [[ "$svnOutput" != *"is not a working copy" ]] ; then
- SCM="svn"
- fi
- fi
- fi
- if [ "${SCM}" == "NONE" ] ; then
- echo "The current workspace is not under Source Control (GIT or SVN)"
- exit 1
- fi
-}
-###############################################################################
-prepareSCM() {
- gitOrSvn
- if [ "${DIRTYSCM}" != "true" ] ; then
- if [ "${RESETSCM}" == "true" ] ; then
- if [ "${SCM}" == "git" ] ; then
- git reset --hard HEAD > /dev/null
- git clean -f -d -e $TESTPATCHDIRNAME > /dev/null
- fi
- if [ "${SCM}" == "svn" ] ; then
- svn revert -R . > /dev/null
- svn status | grep "\?" | awk '{print $2}' | xargs rm -rf
- fi
- else
- echo "It should not happen DIRTYSCM=false & RESETSCM=false"
- exit 1
- fi
- echo "Cleaning local ${SCM} workspace" >> ${SUMMARYFILE}
- else
- echo "WARNING: Running test-patch on a dirty local ${SCM} workspace"
>> ${SUMMARYFILE}
- fi
-}
-###############################################################################
-prepareTestPatchDirs() {
- mkdir -p ${TESTPATCHDIR} 2> /dev/null
- rm -rf ${REPORTDIR} 2> /dev/null
- rm -rf ${TEMPDIR} 2> /dev/null
- mkdir -p ${TOOLSDIR} 2> /dev/null
- mkdir -p ${TEMPDIR} 2> /dev/null
- mkdir -p ${REPORTDIR} 2> /dev/null
- if [ ! -e "${TESTPATCHDIR}" ] ; then
- echo "Could not create test-patch/ dir"
- exit 1
- fi
-}
-###############################################################################
-updateJira() {
- if [[ "${JIRAUPDATE}" != "" && "${JIRAISSUE}" != "" ]] ; then
- if [[ "$JIRAPASSWORD" != "" ]] ; then
- JIRACLI=${TOOLSDIR}/jira-cli/jira.sh
- if [ ! -e "${JIRACLI}" ] ; then
- curl
https://bobswift.atlassian.net/wiki/download/attachments/16285777/jira-cli-2.6.0-distribution.zip
> ${TEMPDIR}/jira-cli.zip
- if [ $? != 0 ] ; then
- echo
- echo "Could not download jira-cli tool, thus no JIRA
updating"
- echo
- exit 1
- fi
- mkdir ${TEMPDIR}/jira-cli-tmp
- (cd ${TEMPDIR}/jira-cli-tmp;jar xf ${TEMPDIR}/jira-cli.zip; mv
jira-cli-2.6.0 ${TOOLSDIR}/jira-cli)
- chmod u+x ${JIRACLI}
- fi
- echo "Adding comment to JIRA"
- comment=`cat ${SUMMARYFILE}`
- $JIRACLI -s $JIRAURL -a addcomment -u $JIRAUSER -p "$JIRAPASSWORD"
--comment "$comment" --issue $JIRAISSUE
- echo
- else
- echo "Skipping JIRA update"
- echo
- fi
- fi
-}
-###############################################################################
-cleanupAndExit() {
- updateJira
- exit $1
-}
-###############################################################################
-printUsage() {
- echo "Usage: $0 <OPTIONS>"
- echo " (--jira=<JIRA ISSUE> | --patch=<PATCH PATH>)"
- echo " (--reset-scm | --dirty-scm)"
- echo " [--tasks=<TASK,...>]"
- echo " [--skip-tasks=<TASK,...>]"
- echo " [--jira-cli=<JIRA CLIENT>]"
- echo " [--jira-user=<JIRA USER>]"
- echo " [--jira-password=<JIRA PASSWORD>]"
- echo " [-D<MVN PROPERTY>...]"
- echo " [-P<MVN PROFILE>...]"
- echo " [--list-tasks]"
- echo " [--verbose]"
- echo
-}
-###############################################################################
-parseArgs() {
- for i in $*
- do
- case $i in
- --jira=*)
- JIRAISSUE=${i#*=}
- ;;
- --patch=*)
- PATCHFILE=${i#*=}
- ;;
- --tasks=*)
- TASKSTORUN=${i#*=}
- ;;
- --skip-tasks=*)
- TASKSTOSKIP=${i#*=}
- ;;
- --list-tasks)
- listTasks
- cleanupAndExit 0
- ;;
- --jira-cli=*)
- JIRACLI=${i#*=}
- ;;
- --jira-user=*)
- JIRAUSER=${i#*=}
- ;;
- --jira-password=*)
- JIRAPASSWORD=${i#*=}
- JIRAUPDATE="true"
- ;;
- -D*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- -P*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- --reset-scm)
- RESETSCM="true"
- ;;
- --dirty-scm)
- DIRTYSCM="true"
- ;;
- --verbose)
- VERBOSEOPTION="--verbose"
- STDOUT="/dev/stdout"
- ;;
- *)
- echo "Invalid option"
- echo
- printUsage
- exit 1
- ;;
- esac
- done
-
- if [[ "${JIRAISSUE}" == "" && "${PATCHFILE}" == "" ]] ; then
- echo "Either --jira or --patch option must be specified"
- echo
- printUsage
- exit 1
- fi
- if [[ "${JIRAISSUE}" != "" && "${PATCHFILE}" != "" ]] ; then
- echo "Cannot specify --jira or --patch options together"
- echo
- printUsage
- exit 1
- fi
- if [[ "${RESETSCM}" == "false" && "${DIRTYSCM}" == "false" ]] ; then
- echo "Either --reset-scm or --dirty-scm option must be specified"
- echo
- printUsage
- exit 1
- fi
- if [[ "${RESETSCM}" == "true" && "${DIRTYSCM}" == "true" ]] ; then
- echo "Cannot specify --reset-scm and --dirty-scm options together"
- echo
- printUsage
- exit 1
- fi
-}
-
-###############################################################################
-listTasks() {
- echo "Available Tasks:"
- echo ""
- getAllTasks
- for taskFile in ${TASKFILES} ; do
- taskName=`bash $taskFile --taskname`
- echo " $taskName"
- done
- echo
-}
-###############################################################################
-downloadPatch () {
- PATCHFILE=${TEMPDIR}/test.patch
- jiraPage=${TEMPDIR}/jira.txt
- curl "${JIRAURLISSUEPREFIX}${JIRAISSUE}" > ${jiraPage}
- if [[ `grep -c 'Patch Available' ${jiraPage}` == 0 ]] ; then
- echo "$JIRAISSUE is not \"Patch Available\". Exiting."
- echo
- exit 1
- fi
- relativePatchURL=`grep -o '"/jira/secure/attachment/[0-9]*/[^"]*'
${jiraPage} \
- | grep -v -e 'htm[l]*$' | sort | tail -1 \
- | grep -o '/jira/secure/attachment/[0-9]*/[^"]*'`
- patchURL="${JIRAHOST}${relativePatchURL}"
- patchNum=`echo $patchURL | grep -o '[0-9]*/' | grep -o '[0-9]*'`
- curl ${patchURL} > ${PATCHFILE}
- if [[ $? != 0 ]] ; then
- echo "Could not download patch for ${JIRAISSUE} from ${patchURL}"
- echo
- cleanupAndExit 1
- fi
- PATCHNAME=$(echo $patchURL | sed 's/.*\///g')
- echo "JIRA ${JIRAISSUE}, patch downloaded at `date` from ${patchURL}"
- echo
- echo "Patch [$PATCHNAME|$patchURL] downloaded at $(date)" >> ${SUMMARYFILE}
- echo "" >> ${SUMMARYFILE}
-}
-###############################################################################
-applyPatch() {
- echo "Applying patch" >> $STDOUT
- echo "" >> $STDOUT
- patch -f -E --dry-run -p0 < ${PATCHFILE} | tee
${REPORTDIR}/APPLY-PATCH.txt \
- >> $STDOUT
- if [[ ${PIPESTATUS[0]} != 0 ]] ; then
- echo "Patch failed to apply to head of branch"
- echo "{color:red}-1{color} Patch failed to apply to head of branch" >>
${SUMMARYFILE}
- echo "" >> ${SUMMARYFILE}
- echo "----------------------------" >> ${SUMMARYFILE}
- echo
- cleanupAndExit 1
- fi
- patch -f -E -p0 < ${PATCHFILE} > ${REPORTDIR}/APPLY-PATCH.txt
- if [[ $? != 0 ]] ; then
- echo "ODD!, dry run passed, but patch failed to apply to head of
branch"
- echo
- cleanupAndExit 1
- fi
- echo "" >> $STDOUT
- echo "Patch applied"
- echo "{color:green}+1 PATCH_APPLIES{color}" >> $SUMMARYFILE
- echo
-}
-###############################################################################
-run() {
- task=`bash $1 --taskname`
- if [[ "${TASKSTORUN}" == "" || "${TASKSTORUN}" =~ "${task}" ]] ; then
- if [[ ! "${TASKSTOSKIP}" =~ "${task}" ]] ; then
- echo " Running test-patch task ${task}"
- outputFile="`basename $1`-$2.out"
- $1 --op=$2 --tempdir=${TEMPDIR} --reportdir=${REPORTDIR} \
- --summaryfile=${SUMMARYFILE} --patchfile=${PATCHFILE}
${MVNPASSTHRU} \
- ${VERBOSEOPTION} | tee ${TEMPDIR}/${outputFile} >> $STDOUT
- if [[ $? != 0 ]] ; then
- echo " Failure, check for details ${TEMPDIR}/${outputFile}"
- echo
- cleanupAndExit 1
- fi
- fi
- fi
-}
-###############################################################################
-getAllTasks() {
- TASKFILES=`ls -a bin/test\-patch\-[0-9][0-9]\-*`
-}
-###############################################################################
-prePatchRun() {
- echo "Pre patch"
- for taskFile in ${TASKFILES} ; do
- run $taskFile pre
- done
- echo
-}
-###############################################################################
-postPatchRun() {
- echo "Post patch"
- for taskFile in ${TASKFILES} ; do
- run $taskFile post
- done
- echo
-}
-###############################################################################
-createReports() {
- echo "Reports"
- for taskFile in ${TASKFILES} ; do
- run $taskFile report
- done
- echo
-}
-###############################################################################
-
-echo
-
-parseArgs "$@"
-
-prepareSCM
-
-prepareTestPatchDirs
-
-echo "" > ${SUMMARYFILE}
-
-if [ "${PATCHFILE}" == "" ] ; then
- echo "Testing JIRA ${JIRAISSUE}"
- echo
- echo "Testing JIRA ${JIRAISSUE}" >> ${SUMMARYFILE}
- echo "" >> ${SUMMARYFILE}
-else
- if [ ! -e ${PATCHFILE} ] ; then
- echo "Patch file does not exist"
- cleanupAndExit 1
- fi
- echo "Testing patch ${PATCHFILE}"
- echo
- echo "Testing patch ${PATCHFILE}" >> ${SUMMARYFILE}
- echo "" >> ${SUMMARYFILE}
-fi
-
-echo "" >> ${SUMMARYFILE}
-
-if [ "${PATCHFILE}" == "" ] ; then
- downloadPatch ${JIRAISSUE}
-fi
-
-echo "----------------------------" >> ${SUMMARYFILE}
-echo "" >> ${SUMMARYFILE}
-getAllTasks
-prePatchRun
-applyPatch
-postPatchRun
-createReports
-echo "" >> ${SUMMARYFILE}
-echo "----------------------------" >> ${SUMMARYFILE}
-MINUSONES=`grep -c "\}\-1" ${SUMMARYFILE}`
-if [[ $MINUSONES == 0 ]]; then
- echo "{color:green}*+1 Overall result, good!, no -1s*{color}" >>
${SUMMARYFILE}
-else
- echo "{color:red}*-1 Overall result, please check the reported
-1(s)*{color}" >> ${SUMMARYFILE}
-fi
-echo "" >> ${SUMMARYFILE}
-WARNINGS=`grep -c "\}WARNING" ${SUMMARYFILE}`
-if [[ $WARNINGS != 0 ]]; then
- echo "{color:red}. There is at least one warning, please check{color}"
>> ${SUMMARYFILE}
-fi
-echo "" >> ${SUMMARYFILE}
-
-if [ ! -z "${JIRAISSUE}" ]; then
- echo "The full output of the test-patch run is available at" >>
${SUMMARYFILE}
- echo "" >> ${SUMMARYFILE}
- echo ". ${BUILD_URL}" >> ${SUMMARYFILE}
- echo "" >> ${SUMMARYFILE}
-else
- echo
- echo "Refer to ${REPORTDIR} for detailed test-patch reports"
- echo
-fi
-
-cat ${SUMMARYFILE} | sed -e 's/{color}//' -e 's/{color:green}//' -e
's/{color:red}//' -e 's/^\.//' -e 's/^\*//' -e 's/\*$//' > ${SUMMARYFILETXT}
-
-cat ${SUMMARYFILETXT}
-
-cleanupAndExit `expr $MINUSONES != 0`
diff --git a/bin/test-patch-00-clean b/bin/test-patch-00-clean
deleted file mode 100755
index d266bbe..0000000
--- a/bin/test-patch-00-clean
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/bin/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.
-
-if [ "${TESTPATCHDEBUG}" == "true" ] ; then
- set -x
-fi
-
-BASEDIR=$(pwd)
-TASKNAME="CLEAN"
-OP=""
-TEMPDIR=""
-REPORTDIR=""
-SUMMARYFILE=""
-MVNPASSTHRU=""
-
-###############################################################################
-cleanupAndExit() {
- exit $1
-}
-###############################################################################
-printUsage() {
- echo "Usage: $0 --taskname | (--op=pre|post|report --tempdir=<TEMP DIR>)
[-D<VALUE>...] [-P<VALUE>...]"
- echo
-}
-###############################################################################
-parseArgs() {
- for i in $*
- do
- case $i in
- --taskname)
- echo ${TASKNAME}
- exit 0
- ;;
- --op=*)
- OP=${i#*=}
- ;;
- --tempdir=*)
- TEMPDIR=${i#*=}
- ;;
- --reportdir=*)
- REPORTDIR=${i#*=}
- ;;
- --summaryfile=*)
- SUMMARYFILE=${i#*=}
- ;;
- -D*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- -P*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- esac
- done
- if [[ "${OP}" == "" || "${TEMPDIR}" == "" ]] ; then
- echo "Missing options"
- echo
- printUsage
- cleanupAndExit 1
- fi
- if [[ "${OP}" != "pre" && "${OP}" != "post" && "${OP}" != "report" ]] ;
then
- echo "Invalid operation"
- echo
- printUsage
- cleanupAndExit 1
- fi
-}
-###############################################################################
-
-
-parseArgs "$@"
-
-case $OP in
-pre)
- mvn clean ${MVNPASSTHRU} > ${TEMPDIR}/${TASKNAME}.txt
- EXITCODE=$?
- # removing files created by dependency:copy-dependencies
- rm -f */lib/*
- exit $EXITCODE
- ;;
-post)
- mvn clean ${MVNPASSTHRU} >> ${TEMPDIR}/${TASKNAME}.txt
- EXITCODE=$?
- ;;
-report)
- echo "{color:green}+1 ${TASKNAME}{color}" >> $SUMMARYFILE
- ;;
-esac
-
-exit 0
diff --git a/bin/test-patch-05-patch-raw-analysis
b/bin/test-patch-05-patch-raw-analysis
deleted file mode 100755
index 52c0b2f..0000000
--- a/bin/test-patch-05-patch-raw-analysis
+++ /dev/null
@@ -1,165 +0,0 @@
-#!/bin/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.
-source $(dirname "$0")/raw-check-patch
-
-if [ "${TESTPATCHDEBUG}" == "true" ] ; then
- set -x
-fi
-
-BASEDIR=$(pwd)
-TASKNAME="RAW_PATCH_ANALYSIS"
-OP=""
-TEMPDIR=""
-REPORTDIR=""
-SUMMARYFILE=""
-PATCHFILE=""
-
-###############################################################################
-cleanupAndExit() {
- exit $1
-}
-###############################################################################
-printUsage() {
- echo "Usage: $0 --taskname | (--op=pre|post|report --tempdir=<TEMP DIR>
--reportdir=<REPORT DIR> --summaryfile=<SUMMARY FILE>)"
- echo
-}
-###############################################################################
-parseArgs() {
- for i in $*
- do
- case $i in
- --taskname)
- echo ${TASKNAME}
- exit 0
- ;;
- --op=*)
- OP=${i#*=}
- ;;
- --tempdir=*)
- TEMPDIR=${i#*=}
- ;;
- --reportdir=*)
- REPORTDIR=${i#*=}
- ;;
- --summaryfile=*)
- SUMMARYFILE=${i#*=}
- ;;
- --patchfile=*)
- PATCHFILE=${i#*=}
- ;;
- esac
- done
- if [[ "${TASKNAME}" == "" || "${OP}" == "" || "${TEMPDIR}" == "" ||
"${REPORTDIR}" == "" || "${SUMMARYFILE}" == "" || "${PATCHFILE}" == "" ]] ; then
- echo "Missing options"
- echo
- printUsage
- cleanupAndExit 1
- fi
- if [[ "${OP}" != "pre" && "${OP}" != "post" && "${OP}" != "report" ]] ;
then
- echo "Invalid operation"
- echo
- printUsage
- cleanupAndExit 1
- fi
-}
-###############################################################################
-checkNoAuthors() {
- TMPFILE=$TEMPDIR/$TASKNAME-authors.txt
- printAuthors $PATCHFILE > $TMPFILE
- authorTags=$(wc -l $TMPFILE | awk '{print $1}')
- if [[ ${authorTags} != 0 ]] ; then
- REPORT+=("{color:red}-1{color} the patch seems to contain
${authorTags} line(s) with @author tags")
- REPORT+=("$(cat $TMPFILE)")
- else
- REPORT+=("{color:green}+1{color} the patch does not introduce any
@author tags")
- fi
-}
-###############################################################################
-checkNoTabs() {
- TMPFILE=$TEMPDIR/$TASKNAME-tabs.txt
- printTabs $PATCHFILE > $TMPFILE
- tabs=$(wc -l $TMPFILE | awk '{print $1}')
- if [[ ${tabs} != 0 ]] ; then
- REPORT+=("{color:red}-1{color} the patch contains ${tabs} line(s) with
tabs")
- REPORT+=("$(cat $TMPFILE)")
- else
- REPORT+=("{color:green}+1{color} the patch does not introduce any
tabs")
- fi
-}
-###############################################################################
-checkNoTrailingSpaces() {
- TMPFILE=$TEMPDIR/$TASKNAME-trailingspaces.txt
- printTrailingSpaces $PATCHFILE > $TMPFILE
- trailingSpaces=$(wc -l $TMPFILE | awk '{print $1}')
- if [[ ${trailingSpaces} != 0 ]] ; then
- REPORT+=("{color:red}-1{color} the patch contains ${trailingSpaces}
line(s) with trailing spaces")
- REPORT+=("$(cat $TMPFILE)")
- else
- REPORT+=("{color:green}+1{color} the patch does not introduce any
trailing spaces")
- fi
-}
-###############################################################################
-checkLinesLength() {
- TMPFILE=$TEMPDIR/$TASKNAME-trailingspaces.txt
- printLongLines $PATCHFILE > $TMPFILE
- longLines=$(wc -l $TMPFILE | awk '{print $1}')
- if [[ ${longLines} != 0 ]] ; then
- REPORT+=("{color:red}-1{color} the patch contains ${longLines} line(s)
longer than 120 characters")
- REPORT+=("$(cat $TMPFILE)")
- else
- REPORT+=("{color:green}+1{color} the patch does not introduce any line
longer than 120")
- fi
-}
-###############################################################################
-checkForTestcases() {
- testcases=`grep -c -i -e '^+++.*/test' ${PATCHFILE}`
- if [[ ${testcases} == 0 ]] ; then
- REPORT+=("{color:red}-1{color} the patch does not add/modify any
testcase")
- #reverting for summary +1 calculation
- testcases=1
- else
- REPORT+=("{color:green}+1{color} the patch does adds/modifies
${testcases} testcase(s)")
- #reverting for summary +1 calculation
- testcases=0
- fi
-}
-###############################################################################
-
-parseArgs "$@"
-
-case $OP in
-pre)
- ;;
-post)
- ;;
-report)
- REPORT=()
- checkNoAuthors
- checkNoTabs
- checkNoTrailingSpaces
- checkLinesLength
- checkForTestcases
- total=`expr $authorTags + $tabs + $trailingSpaces + $longLines +
$testcases`
- if [[ $total == 0 ]] ; then
- echo "{color:green}+1 ${TASKNAME}{color}" >> $SUMMARYFILE
- else
- echo "{color:red}-1 ${TASKNAME}{color}" >> $SUMMARYFILE
- fi
- for line in "${REPORT[@]}" ; do
- echo ". ${line}" >> $SUMMARYFILE
- done
- ;;
-esac
-
-exit 0
diff --git a/bin/test-patch-08-rat b/bin/test-patch-08-rat
deleted file mode 100755
index f403301..0000000
--- a/bin/test-patch-08-rat
+++ /dev/null
@@ -1,132 +0,0 @@
-#!/bin/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.
-
-if [ "${TESTPATCHDEBUG}" == "true" ] ; then
- set -x
-fi
-
-BASEDIR=$(pwd)
-TASKNAME="RAT"
-OP=""
-TEMPDIR=""
-REPORTDIR=""
-SUMMARYFILE=""
-STDOUT="/dev/null"
-MVNPASSTHRU=""
-
-###############################################################################
-cleanupAndExit() {
- exit $1
-}
-###############################################################################
-printUsage() {
- echo "Usage: $0 --taskname | (--op=pre|post|report --tempdir=<TEMP DIR>
--reportdir=<REPORT DIR> --summaryfile=<SUMMARY FILE>) [-D<VALUE>...]
[-P<VALUE>...]"
- echo
-}
-###############################################################################
-parseArgs() {
- for i in $*
- do
- case $i in
- --taskname)
- echo ${TASKNAME}
- exit 0
- ;;
- --op=*)
- OP=${i#*=}
- ;;
- --tempdir=*)
- TEMPDIR=${i#*=}
- ;;
- --reportdir=*)
- REPORTDIR=${i#*=}
- ;;
- --summaryfile=*)
- SUMMARYFILE=${i#*=}
- ;;
- --verbose)
- STDOUT="/dev/stdout"
- ;;
- -D*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- -P*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- esac
- done
- if [[ "${TASKNAME}" == "" || "${OP}" == "" || "${TEMPDIR}" == "" ||
"${REPORTDIR}" == "" || "${SUMMARYFILE}" == "" ]] ; then
- echo "Missing options"
- echo
- printUsage
- cleanupAndExit 1
- fi
- if [[ "${OP}" != "pre" && "${OP}" != "post" && "${OP}" != "report" ]] ;
then
- echo "Invalid operation"
- echo
- printUsage
- cleanupAndExit 1
- fi
-}
-###############################################################################
-checkForWarnings() {
- cleanWarns=`grep -c '\!?????' ${REPORTDIR}/${TASKNAME}-clean.txt`
- patchWarns=`grep -c '\!?????' ${REPORTDIR}/${TASKNAME}-patch.txt`
- newWarns=`expr $patchWarns - $cleanWarns`
- if [[ $newWarns -le 0 ]] ; then
- REPORT+=("{color:green}+1{color} the patch does not seem to introduce
new RAT warnings")
- newWarns=0
- else
- REPORT+=("{color:red}-1{color} the patch seems to introduce $newWarns
new RAT warning(s)")
- newWarns=1
- fi
- if [[ $cleanWarns != 0 ]] ; then
- REPORT+=("{color:red}WARNING: the current HEAD has $cleanWarns RAT
warning(s), they should be addressed ASAP{color}")
- fi
-}
-###############################################################################
-copyRatFiles() {
- TAG=$1
- rm -f ${REPORTDIR}/${TASKNAME}-$TAG.txt
- for f in $(find . -name rat.txt); do
- cat $f >> ${REPORTDIR}/${TASKNAME}-$TAG.txt
- done
-}
-###############################################################################
-
-parseArgs "$@"
-
-case $OP in
-pre)
- mvn apache-rat:check ${MVNPASSTHRU} > $STDOUT
- copyRatFiles clean
- ;;
-post)
- mvn apache-rat:check ${MVNPASSTHRU} > $STDOUT
- copyRatFiles patch
- ;;
-report)
- checkForWarnings
- if [[ $newWarns == 0 ]] ; then
- echo "{color:green}+1 ${TASKNAME}{color}" >> $SUMMARYFILE
- else
- echo "{color:red}-1 ${TASKNAME}{color}" >> $SUMMARYFILE
- fi
- for line in "${REPORT[@]}" ; do
- echo ". ${line}" >> $SUMMARYFILE
- done
- ;;
-esac
-
-exit 0
diff --git a/bin/test-patch-09-javadoc b/bin/test-patch-09-javadoc
deleted file mode 100755
index 54bbf93..0000000
--- a/bin/test-patch-09-javadoc
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/bin/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.
-
-if [ "${TESTPATCHDEBUG}" == "true" ] ; then
- set -x
-fi
-
-BASEDIR=$(pwd)
-TASKNAME="JAVADOC"
-OP=""
-TEMPDIR=""
-REPORTDIR=""
-SUMMARYFILE=""
-MVNPASSTHRU=""
-
-###############################################################################
-cleanupAndExit() {
- exit $1
-}
-###############################################################################
-printUsage() {
- echo "Usage: $0 --taskname | (--op=pre|post|report --tempdir=<TEMP DIR>
--reportdir=<REPORT DIR> --summaryfile=<SUMMARY FILE>) [-D<VALUE>...]
[-P<VALUE>...]"
- echo
-}
-###############################################################################
-parseArgs() {
- for i in $*
- do
- case $i in
- --taskname)
- echo ${TASKNAME}
- exit 0
- ;;
- --op=*)
- OP=${i#*=}
- ;;
- --tempdir=*)
- TEMPDIR=${i#*=}
- ;;
- --reportdir=*)
- REPORTDIR=${i#*=}
- ;;
- --summaryfile=*)
- SUMMARYFILE=${i#*=}
- ;;
- -D*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- -P*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- esac
- done
- if [[ "${TASKNAME}" == "" || "${OP}" == "" || "${TEMPDIR}" == "" ||
"${REPORTDIR}" == "" || "${SUMMARYFILE}" == "" ]] ; then
- echo "Missing options"
- echo
- printUsage
- cleanupAndExit 1
- fi
- if [[ "${OP}" != "pre" && "${OP}" != "post" && "${OP}" != "report" ]] ;
then
- echo "Invalid operation"
- echo
- printUsage
- cleanupAndExit 1
- fi
-}
-###############################################################################
-checkForWarnings() {
- cleanWarns=`grep '\[WARNING\]' ${REPORTDIR}/${TASKNAME}-clean.txt | awk
'/Javadoc Warnings/,EOF' | grep warning | awk 'BEGIN {total = 0} {total += 1}
END {print total}'`
- patchWarns=`grep '\[WARNING\]' ${REPORTDIR}/${TASKNAME}-patch.txt | awk
'/Javadoc Warnings/,EOF' | grep warning | awk 'BEGIN {total = 0} {total += 1}
END {print total}'`
- newWarns=`expr $patchWarns - $cleanWarns`
- if [[ $newWarns -le 0 ]] ; then
- REPORT+=("{color:green}+1{color} the patch does not seem to introduce
new Javadoc warnings")
- newWarns=0
- else
- REPORT+=("{color:red}-1{color} the patch seems to introduce $newWarns
new Javadoc warning(s)")
- newWarns=1
- fi
- if [[ $cleanWarns != 0 ]] ; then
- REPORT+=("{color:red}WARNING{color}: the current HEAD has $cleanWarns
Javadoc warning(s)")
- fi
-}
-###############################################################################
-
-parseArgs "$@"
-
-case $OP in
-pre)
- mvn clean javadoc:aggregate ${MVNPASSTHRU} >
${REPORTDIR}/${TASKNAME}-clean.txt
- ;;
-post)
- mvn clean javadoc:aggregate ${MVNPASSTHRU} >
${REPORTDIR}/${TASKNAME}-patch.txt
- ;;
-report)
- checkForWarnings
- if [[ $newWarns == 0 ]] ; then
- echo "{color:green}+1 ${TASKNAME}{color}" >> $SUMMARYFILE
- else
- echo "{color:red}-1 ${TASKNAME}{color}" >> $SUMMARYFILE
- fi
- for line in "${REPORT[@]}" ; do
- echo ". ${line}" >> $SUMMARYFILE
- done
- ;;
-esac
-
-exit 0
diff --git a/bin/test-patch-10-compile b/bin/test-patch-10-compile
deleted file mode 100755
index 5714b22..0000000
--- a/bin/test-patch-10-compile
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/bin/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.
-
-if [ "${TESTPATCHDEBUG}" == "true" ] ; then
- set -x
-fi
-
-BASEDIR=$(pwd)
-TASKNAME="COMPILE"
-OP=""
-TEMPDIR=""
-REPORTDIR=""
-SUMMARYFILE=""
-STDOUT="/dev/null"
-MVNPASSTHRU=""
-
-###############################################################################
-cleanupAndExit() {
- exit $1
-}
-###############################################################################
-printUsage() {
- echo "Usage: $0 --taskname | (--op=pre|post|report --tempdir=<TEMP DIR>
--reportdir=<REPORT DIR> --summaryfile=<SUMMARY FILE>) [--verbose]
[-D<VALUE>...] [-P<VALUE>...]"
- echo
-}
-###############################################################################
-parseArgs() {
- for i in $*
- do
- case $i in
- --taskname)
- echo ${TASKNAME}
- exit 0
- ;;
- --op=*)
- OP=${i#*=}
- ;;
- --tempdir=*)
- TEMPDIR=${i#*=}
- ;;
- --reportdir=*)
- REPORTDIR=${i#*=}
- ;;
- --summaryfile=*)
- SUMMARYFILE=${i#*=}
- ;;
- --verbose)
- STDOUT="/dev/stdout"
- ;;
- -D*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- -P*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- esac
- done
- if [[ "${TASKNAME}" == "" || "${OP}" == "" || "${TEMPDIR}" == "" ||
"${REPORTDIR}" == "" || "${SUMMARYFILE}" == "" ]] ; then
- echo "Missing options"
- echo
- printUsage
- cleanupAndExit 1
- fi
- if [[ "${OP}" != "pre" && "${OP}" != "post" && "${OP}" != "report" ]] ;
then
- echo "Invalid operation"
- echo
- printUsage
- cleanupAndExit 1
- fi
-}
-###############################################################################
-checkForWarnings() {
- grep '\[WARNING\]' ${REPORTDIR}/${TASKNAME}-clean.txt >
${TEMPDIR}/${TASKNAME}-javacwarns-clean.txt
- grep '\[WARNING\]' ${REPORTDIR}/${TASKNAME}-patch.txt >
${TEMPDIR}/${TASKNAME}-javacwarns-patch.txt
- cleanWarns=`cat ${TEMPDIR}/${TASKNAME}-javacwarns-clean.txt | awk 'BEGIN
{total = 0} {total += 1} END {print total}'`
- patchWarns=`cat ${TEMPDIR}/${TASKNAME}-javacwarns-patch.txt | awk 'BEGIN
{total = 0} {total += 1} END {print total}'`
- newWarns=`expr $patchWarns - $cleanWarns`
- if [[ $newWarns -le 0 ]] ; then
- REPORT+=("{color:green}+1{color} the patch does not seem to introduce
new javac warnings")
- newWarns=0
- else
- REPORT+=("{color:red}-1{color} the patch seems to introduce $newWarns
new javac warning(s)")
- newWarns=1
- fi
- if [[ $cleanWarns != 0 ]] ; then
- REPORT+=("{color:red}WARNING{color}: the current HEAD has $cleanWarns
javac warning(s)")
- fi
-}
-###############################################################################
-
-
-parseArgs "$@"
-
-case $OP in
-pre)
- mvn clean install -DskipTests ${MVNPASSTHRU} | tee
${REPORTDIR}/${TASKNAME}-clean.txt >> $STDOUT
- if [[ ${PIPESTATUS[0]} == 0 ]] ; then
- echo "{color:green}+1{color} HEAD compiles" >>
${TEMPDIR}/${TASKNAME}-compile.txt
- else
- echo "{color:red}-1{color} HEAD does not compile" >>
${TEMPDIR}/${TASKNAME}-compile.txt
- fi
- ;;
-post)
- mvn clean install -DskipTests ${MVNPASSTHRU} | tee
${REPORTDIR}/${TASKNAME}-patch.txt >> $STDOUT
- if [[ ${PIPESTATUS[0]} == 0 ]] ; then
- echo "{color:green}+1{color} patch compiles" >>
${TEMPDIR}/${TASKNAME}-compile.txt
- else
- echo "{color:red}-1{color} patch does not compile" >>
${TEMPDIR}/${TASKNAME}-compile.txt
- fi
- ;;
-report)
- REPORT=()
- compileErrors=0
- while read line; do
- REPORT+=("$line")
- if [[ "$line" =~ "-1" ]] ; then
- compileErrors=1
- fi
- done < ${TEMPDIR}/${TASKNAME}-compile.txt
- checkForWarnings
- total=`expr $compileErrors + $newWarns`
- if [[ $total == 0 ]] ; then
- echo "{color:green}+1 ${TASKNAME}{color}" >> $SUMMARYFILE
- else
- echo "{color:red}-1 ${TASKNAME}{color}" >> $SUMMARYFILE
- fi
- for line in "${REPORT[@]}" ; do
- echo ". ${line}" >> $SUMMARYFILE
- done
- ;;
-esac
-
-exit 0
diff --git a/bin/test-patch-11-findbugs b/bin/test-patch-11-findbugs
deleted file mode 100755
index c91daff..0000000
--- a/bin/test-patch-11-findbugs
+++ /dev/null
@@ -1,156 +0,0 @@
-#!/bin/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.
-
-if [ "${TESTPATCHDEBUG}" == "true" ] ; then
- set -x
-fi
-
-BASEDIR=$(pwd)
-TASKNAME="FINDBUGS"
-OP=""
-TEMPDIR=""
-REPORTDIR=""
-SUMMARYFILE=""
-STDOUT="/dev/null"
-MVNPASSTHRU=""
-
-###############################################################################
-cleanupAndExit() {
- exit $1
-}
-###############################################################################
-printUsage() {
- echo "Usage: $0 --taskname | (--op=pre|post|report --tempdir=<TEMP DIR>
--reportdir=<REPORT DIR> --summaryfile=<SUMMARY FILE>) [-D<VALUE>...]
[-P<VALUE>...]"
- echo
-}
-###############################################################################
-parseArgs() {
- for i in $*
- do
- case $i in
- --taskname)
- echo ${TASKNAME}
- exit 0
- ;;
- --op=*)
- OP=${i#*=}
- ;;
- --tempdir=*)
- TEMPDIR=${i#*=}
- ;;
- --reportdir=*)
- REPORTDIR=${i#*=}
- ;;
- --summaryfile=*)
- SUMMARYFILE=${i#*=}
- ;;
- --verbose)
- STDOUT="/dev/stdout"
- ;;
- -D*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- -P*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- esac
- done
- if [[ "${TASKNAME}" == "" || "${OP}" == "" || "${TEMPDIR}" == "" ||
"${REPORTDIR}" == "" || "${SUMMARYFILE}" == "" ]] ; then
- echo "Missing options"
- echo
- printUsage
- cleanupAndExit 1
- fi
- if [[ "${OP}" != "pre" && "${OP}" != "post" && "${OP}" != "report" ]] ;
then
- echo "Invalid operation"
- echo
- printUsage
- cleanupAndExit 1
- fi
-}
-###############################################################################
-checkForWarnings() {
- cleanBugs=0
- patchBugs=0
- for m in $(getModules); do
- MODNAME=$(echo $m | sed 's/\///')
-
- m_cleanBugs=$(cat ${REPORTDIR}/${TASKNAME}-${MODNAME}-clean.xml \
- | sed 's/<\/BugInstance>/<\/BugInstance>\n/g' | grep BugInstance |
wc -l)
- m_patchBugs=$(cat ${REPORTDIR}/${TASKNAME}-${MODNAME}-patch.xml \
- | sed 's/<\/BugInstance>/<\/BugInstance>\n/g' | grep BugInstance |
wc -l)
- m_newBugs=`expr $m_patchBugs - $m_cleanBugs`
- if [[ $m_newBugs != 0 ]] ; then
- BUGMODULES="$MODNAME $BUGMODULES"
- fi
-
- cleanBugs=$(($cleanBugs+$m_cleanBugs))
- patchBugs=$(($patchBugs+$m_patchBugs))
- done
-
- BUGMODULES=$(echo $BUGMODULES | sed 's/^ *//' | sed 's/ *$//')
- newBugs=`expr $patchBugs - $cleanBugs`
- if [[ $newBugs -le 0 ]] ; then
- REPORT+=("{color:green}+1{color} the patch does not seem to introduce
new Findbugs warnings")
- newBugs=0
- else
- REPORT+=("{color:red}-1{color} the patch seems to introduce $patchBugs
new Findbugs warning(s) in module(s) [$BUGMODULES]")
- newBugs=1
- fi
- if [[ $cleanBugs != 0 ]] ; then
- REPORT+=("{color:red}WARNING: the current HEAD has $cleanWarns
Findbugs warning(s), they should be addressed ASAP{color}")
- fi
-}
-
-###############################################################################
-
-getModules() {
- find . -name pom.xml | sed 's/^.\///' | sed 's/pom.xml$//' | grep -v compat
-}
-###############################################################################
-
-copyFindbugsXml() {
- TAG=$1
- for m in $(getModules); do
- MODNAME=$(echo $m | sed 's/\///')
- cp ${m}target/findbugsXml.xml
${REPORTDIR}/${TASKNAME}-${MODNAME}-$TAG.xml
- done
-}
-
-parseArgs "$@"
-
-
-case $OP in
-pre)
- mvn findbugs:findbugs ${MVNPASSTHRU} > $STDOUT
- copyFindbugsXml clean
- ;;
-post)
- mvn findbugs:findbugs ${MVNPASSTHRU} > $STDOUT
- copyFindbugsXml patch
- ;;
-report)
- checkForWarnings
- if [[ $newBugs == 0 ]] ; then
- echo "{color:green}+1 ${TASKNAME}{color}" >> $SUMMARYFILE
- else
- echo "{color:red}-1 ${TASKNAME}{color}" >> $SUMMARYFILE
- fi
- for line in "${REPORT[@]}" ; do
- echo ". ${line}" >> $SUMMARYFILE
- done
- ;;
-esac
-
-exit 0
diff --git a/bin/test-patch-20-tests b/bin/test-patch-20-tests
deleted file mode 100755
index ab77bcd..0000000
--- a/bin/test-patch-20-tests
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/bin/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.
-
-if [ "${TESTPATCHDEBUG}" == "true" ] ; then
- set -x
-fi
-
-BASEDIR=$(pwd)
-TASKNAME="TESTS"
-OP=""
-TEMPDIR=""
-REPORTDIR=""
-SUMMARYFILE=""
-STDOUT="/dev/null"
-MVNPASSTHRU=""
-
-###############################################################################
-cleanupAndExit() {
- exit $1
-}
-###############################################################################
-printUsage() {
- echo "Usage: $0 --taskname | (--op=pre|post|report --tempdir=<TEMP DIR>
--reportdir=<REPORT DIR> --summaryfile=<SUMMARY FILE>) [--verbose]
[-D<VALUE>...] [-P<VALUE>...]"
- echo
-}
-###############################################################################
-parseArgs() {
- for i in $*
- do
- case $i in
- --taskname)
- echo ${TASKNAME}
- exit 0
- ;;
- --op=*)
- OP=${i#*=}
- ;;
- --tempdir=*)
- TEMPDIR=${i#*=}
- ;;
- --reportdir=*)
- REPORTDIR=${i#*=}
- ;;
- --summaryfile=*)
- SUMMARYFILE=${i#*=}
- ;;
- --verbose)
- STDOUT="/dev/stdout"
- ;;
- -D*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- -P*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- esac
- done
- if [[ "${TASKNAME}" == "" || "${OP}" == "" || "${TEMPDIR}" == "" ||
"${REPORTDIR}" == "" || "${SUMMARYFILE}" == "" ]] ; then
- echo "Missing options"
- echo
- printUsage
- cleanupAndExit 1
- fi
- if [[ "${OP}" != "pre" && "${OP}" != "post" && "${OP}" != "report" ]] ;
then
- echo "Invalid operation"
- echo
- printUsage
- cleanupAndExit 1
- fi
-}
-###############################################################################
-
-parseArgs "$@"
-
-case $OP in
-pre)
- ;;
-post)
- # must use package instead of test so that compat-deps shaded jars are
correct
- mvn package ${MVNPASSTHRU} -Dmaven.test.failure.ignore=true \
- -Dmaven.test.error.ignore=true -fae \
- -Dtest.timeout=7200 | tee ${TEMPDIR}/${TASKNAME}.out >> $STDOUT
- exitCode=${PIPESTATUS[0]}
- echo "$exitCode" > ${TEMPDIR}/${TASKNAME}.exitCode
- ;;
-report)
- failedTests=` find . -name '*\.txt' | grep target/surefire-reports | xargs
grep "<<< FAILURE" | grep -v "Tests run:" | sed 's/.*\.txt\://' | sed 's/
.*//'`
- testsRun=`grep "Tests run:" ${TEMPDIR}/${TASKNAME}.out | grep -v " Time
elapsed:" | awk '{print $3}' | sed 's/,//' | awk 'BEGIN {count=0}
{count=count+$1} END {print count}'`
- testsFailed=`grep "Tests run:" ${TEMPDIR}/${TASKNAME}.out | grep -v " Time
elapsed:" | awk '{print $5}' | sed 's/,//' | awk 'BEGIN {count=0}
{count=count+$1} END {print count}'`
- testsErrors=`grep "Tests run:" ${TEMPDIR}/${TASKNAME}.out | grep -v " Time
elapsed:" | awk '{print $7}' | sed 's/,//' | awk 'BEGIN {count=0}
{count=count+$1} END {print count}'`
- hasFailures=`expr $testsFailed + $testsErrors`
- testsExitCode=`cat ${TEMPDIR}/${TASKNAME}.exitCode`
- if [[ $hasFailures != 0 ]] ; then
- echo "{color:red}-1 ${TASKNAME}{color}" >> $SUMMARYFILE
- echo ". Tests run: $testsRun" >> $SUMMARYFILE
- echo ". Tests failed: $testsFailed" >> $SUMMARYFILE
- echo ". Tests errors: $testsErrors" >> $SUMMARYFILE
- echo "" >> ${SUMMARYFILE}
- echo ". The patch failed the following testcases:" >> $SUMMARYFILE
- echo "" >> ${SUMMARYFILE}
- echo "${failedTests}" | sed 's/^/. /' >> $SUMMARYFILE
- echo "" >> ${SUMMARYFILE}
- else
- if [[ "$testsExitCode" != "0" ]] ; then
- echo "{color:red}-1 ${TASKNAME}{color} - patch does not compile,
cannot run testcases" >> $SUMMARYFILE
- else
- echo "{color:green}+1 ${TASKNAME}{color}" >> $SUMMARYFILE
- echo ". Tests run: $testsRun" >> $SUMMARYFILE
- fi
- fi
- ;;
-esac
-
-exit 0
diff --git a/bin/test-patch-30-dist b/bin/test-patch-30-dist
deleted file mode 100755
index 33d4d6c..0000000
--- a/bin/test-patch-30-dist
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/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.
-
-if [ "${TESTPATCHDEBUG}" == "true" ] ; then
- set -x
-fi
-
-BASEDIR=$(pwd)
-TASKNAME="DISTRO"
-OP=""
-TEMPDIR=""
-REPORTDIR=""
-SUMMARYFILE=""
-STDOUT="/dev/null"
-MVNPASSTHRU=""
-
-###############################################################################
-cleanupAndExit() {
- exit $1
-}
-###############################################################################
-printUsage() {
- echo "Usage: $0 --taskname | (--op=pre|post|report --tempdir=<TEMP DIR>
--reportdir=<REPORT DIR> --summaryfile=<SUMMARY FILE>) [--verbose]
[-D<VALUE>...] [-P<VALUE>...]"
- echo
-}
-###############################################################################
-parseArgs() {
- for i in $*
- do
- case $i in
- --taskname)
- echo ${TASKNAME}
- exit 0
- ;;
- --op=*)
- OP=${i#*=}
- ;;
- --tempdir=*)
- TEMPDIR=${i#*=}
- ;;
- --reportdir=*)
- REPORTDIR=${i#*=}
- ;;
- --summaryfile=*)
- SUMMARYFILE=${i#*=}
- ;;
- --verbose)
- STDOUT="/dev/stdout"
- ;;
- -D*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- -P*)
- MVNPASSTHRU="${MVNPASSTHRU} $i"
- ;;
- esac
- done
- if [[ "${TASKNAME}" == "" || "${OP}" == "" || "${TEMPDIR}" == "" ||
"${REPORTDIR}" == "" || "${SUMMARYFILE}" == "" ]] ; then
- echo "Missing options"
- echo
- printUsage
- cleanupAndExit 1
- fi
- if [[ "${OP}" != "pre" && "${OP}" != "post" && "${OP}" != "report" ]] ;
then
- echo "Invalid operation"
- echo
- printUsage
- cleanupAndExit 1
- fi
-}
-###############################################################################
-
-parseArgs "$@"
-
-case $OP in
-pre)
- ;;
-post)
- mvn package assembly:single -DskipTests | tee ${REPORTDIR}/${TASKNAME}.out
>> $STDOUT
- exitCode=${PIPESTATUS[0]}
- echo "$exitCode" > ${TEMPDIR}/${TASKNAME}.exitCode
- ;;
-report)
- exitCode=`cat ${TEMPDIR}/${TASKNAME}.exitCode`
- if [[ "$exitCode" != "0" ]] ; then
- echo "{color:red}-1 ${TASKNAME}{color}" >> $SUMMARYFILE
- echo ". {color:red}-1{color} distro tarball fails with the patch"
>> $SUMMARYFILE
- else
- echo "{color:green}+1 ${TASKNAME}{color}" >> $SUMMARYFILE
- echo ". {color:green}+1{color} distro tarball builds with the patch
" >> $SUMMARYFILE
- fi
- ;;
-esac
-
-exit 0
diff --git a/bin/update-master-docs b/bin/update-master-docs
deleted file mode 100644
index 96319d8..0000000
--- a/bin/update-master-docs
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/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
-
-BASEDIR=/tmp/update-master-docs
-mkdir -p $BASEDIR
-
-SVNDIR=$BASEDIR/svn
-
-GITDIR=$BASEDIR/git
-
-rm -rf $SVNDIR
-rm -rf $GITDIR
-
-svn checkout
https://svn.apache.org/repos/asf/bookkeeper/site/trunk/content/docs/master
$SVNDIR
-svn checkout https://github.com/apache/bookkeeper/trunk $GITDIR
-
-mvn -f $GITDIR/pom.xml -Dnotimestamp javadoc:aggregate
-
-rsync -avP --exclude=.svn $GITDIR/doc/ $SVNDIR/
-rsync -avP --exclude=.svn $GITDIR/target/site/apidocs/ $SVNDIR/apidocs/
-svn add --force $SVNDIR/*
-
-CHANGES=$(svn status $SVNDIR| awk 'BEGIN { COUNT = 0; } /^[A|M]/ { COUNT =
COUNT + 1; } END { print COUNT }')
-if [ $CHANGES -gt 0 ]; then
- svn commit -m "Syncing website with master documentation" $SVNDIR
- echo
- echo "Now go review on http://bookkeeper.staging.apache.org, and publish
if it's ok"
- echo
-else
- echo "No changes, submitting nothing"
-fi
diff --git a/formatter.xml
b/buildtools/src/main/resources/ide/eclipse/formatter.xml
similarity index 100%
rename from formatter.xml
rename to buildtools/src/main/resources/ide/eclipse/formatter.xml
diff --git a/patch-review.py b/patch-review.py
deleted file mode 100755
index 0c4b763..0000000
--- a/patch-review.py
+++ /dev/null
@@ -1,228 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you 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.
-
-# copy from {@link
https://github.com/apache/kafka/blob/trunk/kafka-patch-review.py}
-
-import argparse
-import sys
-import os
-import time
-import datetime
-import tempfile
-import commands
-import getpass
-from jira.client import JIRA
-
-def get_jira_config():
- # read the config file
- home=jira_home=os.getenv('HOME')
- home=home.rstrip('/')
- if not (os.path.isfile(home + '/jira.ini')):
- jira_user=raw_input('JIRA user :')
- jira_pass=getpass.getpass('JIRA password :')
- jira_config = {'user':jira_user, 'password':jira_pass}
- return jira_config
- else:
- jira_config = dict(line.strip().split('=') for line in open(home +
'/jira.ini'))
- return jira_config
-
-def get_jira(jira_config):
- options = {
- 'server': 'https://issues.apache.org/jira'
- }
- jira = JIRA(options=options,basic_auth=(jira_config['user'],
jira_config['password']))
- # (Force) verify the auth was really done
- jira_session=jira.session()
- if (jira_session is None):
- raise Exception("Failed to login to the JIRA instance")
- return jira
-
-def cmd_exists(cmd):
- status, result = commands.getstatusoutput(cmd)
- return status
-
-def main():
- ''' main(), shut up, pylint '''
- popt = argparse.ArgumentParser(description='BookKeeper patch review tool')
- popt.add_argument('-b', '--branch', action='store', dest='branch',
required=True, help='Tracking branch to create diff against')
- popt.add_argument('-j', '--jira', action='store', dest='jira',
required=True, help='JIRA corresponding to the reviewboard')
- popt.add_argument('-s', '--summary', action='store', dest='summary',
required=False, help='Summary for the reviewboard')
- popt.add_argument('-d', '--description', action='store', dest='description',
required=False, help='Description for reviewboard')
- popt.add_argument('-r', '--rb', action='store', dest='reviewboard',
required=False, help='Review board that needs to be updated')
- popt.add_argument('-t', '--testing-done', action='store', dest='testing',
required=False, help='Text for the Testing Done section of the reviewboard')
- popt.add_argument('-db', '--debug', action='store_true', required=False,
help='Enable debug mode')
- opt = popt.parse_args()
-
- post_review_tool = None
- if (cmd_exists("post-review") == 0):
- post_review_tool = "post-review"
- elif (cmd_exists("rbt") == 0):
- post_review_tool = "rbt post"
- else:
- print "please install RBTools. See
https://www.reviewboard.org/docs/rbtools/dev/ for details."
- sys.exit(1)
-
- patch_file=tempfile.gettempdir() + "/" + opt.jira + ".patch"
- if opt.reviewboard:
- ts = time.time()
- st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d_%H:%M:%S')
- patch_file=tempfile.gettempdir() + "/" + opt.jira + '_' + st + '.patch'
-
- # first check if rebase is needed
- git_branch_hash="git rev-parse " + opt.branch
- p_now=os.popen(git_branch_hash)
- branch_now=p_now.read()
- p_now.close()
-
- git_common_ancestor="git merge-base " + opt.branch + " HEAD"
- p_then=os.popen(git_common_ancestor)
- branch_then=p_then.read()
- p_then.close()
-
- if branch_now != branch_then:
- print 'ERROR: Your current working branch is from an older version of ' +
opt.branch + '. Please rebase first by using git pull --rebase'
- sys.exit(1)
-
- git_configure_reviewboard="git config reviewboard.url
https://reviews.apache.org"
- print "Configuring reviewboard url to https://reviews.apache.org"
- p=os.popen(git_configure_reviewboard)
- p.close()
-
- git_remote_update="git remote update"
- print "Updating your remote branches to pull the latest changes"
- p=os.popen(git_remote_update)
- p.close()
-
- # Get JIRA configuration and login to JIRA to ensure the credentials work,
before publishing the patch to the review board
- print "Verifying JIRA connection configurations"
- try:
- jira_config=get_jira_config()
- jira=get_jira(jira_config)
- except:
- print "Failed to login to the JIRA instance", sys.exc_info()[0],
sys.exc_info()[1]
- sys.exit(1)
-
- git_command="git diff --no-prefix " + opt.branch + " > " + patch_file
- if opt.debug:
- print git_command
- p=os.popen(git_command)
- p.close()
-
- print 'Getting latest patch attached to the JIRA'
- tmp_dir = tempfile.mkdtemp()
- get_latest_patch_command="""
-PATCHFILE={0}/{1}.patch
-jiraPage={0}/jira.txt
-curl "https://issues.apache.org/jira/browse/{1}" > {0}/jira.txt
-if [[ `grep -c 'Patch Available' {0}/jira.txt` == 0 ]] ; then
- echo "{1} is not \"Patch Available\". Exiting."
- echo
- exit 1
-fi
-relativePatchURL=`grep -o '"/jira/secure/attachment/[0-9]*/[^"]*' {0}/jira.txt
\
- | grep -v -e 'htm[l]*$' | sort | tail -1 \
- | grep -o '/jira/secure/attachment/[0-9]*/[^"]*'`
-patchURL="https://issues.apache.org$relativePatchURL"
-curl $patchURL > {0}/{1}.patch
-""".format(tmp_dir, opt.jira)
- p=os.popen(get_latest_patch_command)
- p.close()
-
- previous_patch=tmp_dir + "/" + opt.jira + ".patch"
- diff_file=tmp_dir + "/" + opt.jira + ".diff"
- if os.path.isfile(previous_patch) and os.stat(previous_patch).st_size > 0:
- print 'Creating diff with previous version of patch uploaded to JIRA'
- diff_command = "diff " + previous_patch+ " " + patch_file + " > " +
diff_file
- try:
- p=os.popen(diff_command)
- sys.stdout.flush()
- p.close()
- except:
- pass
- print 'Diff with previous version of patch uploaded to JIRA is saved to '
+ diff_file
-
- print 'Checking if the there are changes that need to be pushed'
- if os.stat(diff_file).st_size == 0:
- print 'No changes found on top of changes uploaded to JIRA'
- print 'Aborting'
- sys.exit(1)
-
- rb_command= post_review_tool + " --publish --tracking-branch " + opt.branch
+ " --target-groups=bookkeeper --bugs-closed=" + opt.jira
- if opt.debug:
- rb_command=rb_command + " --debug"
- summary="Patch for " + opt.jira
- if opt.summary:
- summary=opt.summary
- rb_command=rb_command + " --summary \"" + summary + "\""
- if opt.description:
- rb_command=rb_command + " --description \"" + opt.description + "\""
- if opt.reviewboard:
- rb_command=rb_command + " -r " + opt.reviewboard
- if opt.testing:
- rb_command=rb_command + " --testing-done=" + opt.testing
- if opt.debug:
- print rb_command
- p=os.popen(rb_command)
- rb_url=""
- for line in p:
- print line
- if line.startswith('http'):
- rb_url = line
- elif line.startswith("There don't seem to be any diffs"):
- print 'ERROR: Your reviewboard was not created/updated since there was
no diff to upload. The reasons that can cause this issue are 1) Your diff is
not checked into your local branch. Please check in the diff to the local
branch and retry 2) You are not specifying the local branch name as part of the
--branch option. Please specify the remote branch name obtained from git branch
-r'
- p.close()
- sys.exit(1)
- elif line.startswith("Your review request still exists, but the diff is
not attached") and not opt.debug:
- print 'ERROR: Your reviewboard was not created/updated. Please run the
script with the --debug option to troubleshoot the problem'
- p.close()
- sys.exit(1)
- if p.close() != None:
- print 'ERROR: reviewboard update failed. Exiting.'
- sys.exit(1)
- if opt.debug:
- print 'rb url=',rb_url
-
- print 'Creating diff against', opt.branch, 'and uploading patch to
JIRA',opt.jira
- issue = jira.issue(opt.jira)
- attachment=open(patch_file)
- jira.add_attachment(issue,attachment)
- attachment.close()
-
- comment="Created reviewboard "
- if not opt.reviewboard:
- print 'Created a new reviewboard',rb_url,
- else:
- print 'Updated reviewboard',rb_url
- comment="Updated reviewboard "
-
- comment = comment + rb_url + ' against branch ' + opt.branch
- jira.add_comment(opt.jira, comment)
-
- #update the JIRA status to PATCH AVAILABLE
- transitions = jira.transitions(issue)
- transitionsMap ={}
-
- for t in transitions:
- transitionsMap[t['name']] = t['id']
-
- if('Submit Patch' in transitionsMap):
- jira.transition_issue(issue, transitionsMap['Submit Patch'] ,
assignee={'name': jira_config['user']} )
-
-if __name__ == '__main__':
- sys.exit(main())
diff --git a/site/docker/Dockerfile b/site/docker/Dockerfile
new file mode 100644
index 0000000..3643bd1
--- /dev/null
+++ b/site/docker/Dockerfile
@@ -0,0 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+#
+
+FROM ruby:2.4.1
diff --git a/site/docker/ci.sh b/site/docker/ci.sh
new file mode 100755
index 0000000..2e98840
--- /dev/null
+++ b/site/docker/ci.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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 -e -x -u
+
+SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+
+export IMAGE_NAME="bookkeeper/docs"
+
+pushd ${SCRIPT_DIR}
+
+docker build --rm=true -t ${IMAGE_NAME} .
+
+popd
+
+if [ "$(uname -s)" == "Linux" ]; then
+ USER_NAME=${SUDO_USER:=$USER}
+ USER_ID=$(id -u "${USER_NAME}")
+ GROUP_ID=$(id -g "${USER_NAME}")
+ LOCAL_HOME="/home/${USER_NAME}"
+else # boot2docker uid and gid
+ USER_NAME=$USER
+ USER_ID=1000
+ GROUP_ID=50
+ LOCAL_HOME="/Users/${USER_NAME}"
+fi
+
+docker build -t "${IMAGE_NAME}-${USER_NAME}" - <<UserSpecificDocker
+FROM ${IMAGE_NAME}
+RUN groupadd --non-unique -g ${GROUP_ID} ${USER_NAME} && \
+ useradd -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME}
+ENV HOME /home/${USER_NAME}
+UserSpecificDocker
+
+BOOKKEEPER_DOC_ROOT=${SCRIPT_DIR}/..
+
+pushd ${BOOKKEEPER_DOC_ROOT}
+
+docker run \
+ --rm=true \
+ -w ${BOOKKEEPER_DOC_ROOT} \
+ -u "${USER}" \
+ -v "${BOOKKEEPER_DOC_ROOT}:${BOOKKEEPER_DOC_ROOT}" \
+ -v "${LOCAL_HOME}:/home/${USER_NAME}" \
+ -p 4000:4000 \
+ ${IMAGE_NAME}-${USER_NAME} \
+ bash -c "make setup && make apache"
+
+popd
+
diff --git a/site/docker/run.sh b/site/docker/run.sh
new file mode 100755
index 0000000..a4228ac
--- /dev/null
+++ b/site/docker/run.sh
@@ -0,0 +1,76 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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 -e -x -u
+
+SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+
+export IMAGE_NAME="bookkeeper/docs"
+
+pushd ${SCRIPT_DIR}
+
+docker build --rm=true -t ${IMAGE_NAME} .
+
+popd
+
+if [ "$(uname -s)" == "Linux" ]; then
+ USER_NAME=${SUDO_USER:=$USER}
+ USER_ID=$(id -u "${USER_NAME}")
+ GROUP_ID=$(id -g "${USER_NAME}")
+ LOCAL_HOME="/home/${USER_NAME}"
+else # boot2docker uid and gid
+ USER_NAME=$USER
+ USER_ID=1000
+ GROUP_ID=50
+ LOCAL_HOME="/Users/${USER_NAME}"
+fi
+
+docker build -t "${IMAGE_NAME}-${USER_NAME}" - <<UserSpecificDocker
+FROM ${IMAGE_NAME}
+RUN groupadd --non-unique -g ${GROUP_ID} ${USER_NAME} && \
+ useradd -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME}
+ENV HOME /home/${USER_NAME}
+UserSpecificDocker
+
+BOOKKEEPER_DOC_ROOT=${SCRIPT_DIR}/..
+
+CMD="
+echo
+echo 'Welcome to Apache BookKeeper docs'
+echo 'To build, execute'
+echo ' make build'
+echo 'To watch and regenerate automatically'
+echo ' make serve'
+echo 'and access http://localhost:4000'
+echo
+bash
+"
+
+pushd ${BOOKKEEPER_DOC_ROOT}
+
+docker run -i -t \
+ --rm=true \
+ -w ${BOOKKEEPER_DOC_ROOT} \
+ -u "${USER}" \
+ -v "${BOOKKEEPER_DOC_ROOT}:${BOOKKEEPER_DOC_ROOT}" \
+ -v "${LOCAL_HOME}:/home/${USER_NAME}" \
+ -p 4000:4000 \
+ ${IMAGE_NAME}-${USER_NAME} \
+ bash -c "${CMD}"
+
+popd
+
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].