From 9b78bc1d1aa24320a7d946944d047273db82db84 Mon Sep 17 00:00:00 2001 From: Chris Jaekl Date: Sat, 12 Dec 2015 18:12:15 +0900 Subject: [PATCH] Update script to invoke an analysis from inside Jenkins --- analyze.sh | 23 ----------------------- jenkins_invoke.sh | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 23 deletions(-) delete mode 100755 analyze.sh create mode 100755 jenkins_invoke.sh diff --git a/analyze.sh b/analyze.sh deleted file mode 100755 index 2530a6f..0000000 --- a/analyze.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -JOB_NAME=${1} -BUILD_NUMBER=${2} -OUT_FILE=${3} - -BUILD_WORKSPACE=${SCRIPT_DIR}/../jobs/${JOB_NAME}/workspace - -export FINDBUGS_HOME=${SCRIPT_DIR}/../findbugs-3.0.1 -. ./setcp.sh - -rm cfb.fbp -cat >cfb.fbp < - ${BUILD_WORKSPACE}/bin - ${BUILD_WORKSPACE}/src - -EOF - -cat cfb.fbp -./go.sh -c config.properties -d cfb -u cfb -p cfb -f cfb.fbp -n jenkins_${JOB_NAME}_${BUILD_NUMBER} -o ${OUT_FILE} diff --git a/jenkins_invoke.sh b/jenkins_invoke.sh new file mode 100755 index 0000000..d3e1b00 --- /dev/null +++ b/jenkins_invoke.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -o nounset ## (set -u) error exit on attempts to deref undefined variable +set -o errexit ## (set -e) error exit if subcommand returns nonzero + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +OUT_FILE=${1} + +export FINDBUGS_HOME=${SCRIPT_DIR}/../findbugs-3.0.1 +. ${SCRIPT_DIR}/setcp.sh + +echo CLASSPATH=${CLASSPATH} +echo FINDBUGS_HOME=${FINDBUGS_HOME} + +rm cfb.fbp +cat >cfb.fbp < + ${WORKSPACE}/bin + ${WORKSPACE}/src + +EOF + +cat cfb.fbp +./go.sh -c ${SCRIPT_DIR}/config.properties -d cfb -u cfb -p cfb -f cfb.fbp -n jenkins_${JOB_NAME}_${BUILD_NUMBER} -o ${OUT_FILE} -- 2.39.2