-
Notifications
You must be signed in to change notification settings - Fork 249
/
Copy pathupload-build-log
executable file
·30 lines (28 loc) · 1.18 KB
/
upload-build-log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
CMS_BOT_DIR=$(dirname $0)
case $CMS_BOT_DIR in /*) ;; *) CMS_BOT_DIR=$(pwd)/${CMS_BOT_DIR} ;; esac
WORKSPACE=$1
LOG_SRC=$2
LOG_DES=$3
LOCAL_LOGDIR=$WORKSPACE/cmsBuild_BUILD_logs
mkdir -p ${LOCAL_LOGDIR}/js
if [ -d ${LOG_SRC}/../../DEPS ] ; then mv ${LOG_SRC}/../../DEPS ${LOCAL_LOGDIR}/DEPS ; fi
if [ -f $WORKSPACE/renderPRTests.js ] ; then cp $WORKSPACE/renderPRTests.js ${LOCAL_LOGDIR}/js/ ; fi
for f in summary.html testsResults.txt cmsswtoolconf.log externals.json ; do
if [ -f $WORKSPACE/$f ] ; then cp $WORKSPACE/$f ${LOCAL_LOGDIR}/ ; fi
done
if [ -d "${LOG_SRC}" ] ; then
pushd $LOG_SRC
for log in $(find . -maxdepth 4 -mindepth 4 -name log -type f | sed 's|^./||') ; do
dir=$(dirname $log)
mkdir -p ${LOCAL_LOGDIR}/${dir}
mv $log ${LOCAL_LOGDIR}/${dir}/
[ -e ${dir}/src-logs.tgz ] && mv ${dir}/src-logs.tgz ${LOCAL_LOGDIR}/${dir}/
json=$(basename $(dirname $dir)).json
[ -e "${dir}/${json}" ] && mv ${dir}/${json} ${LOCAL_LOGDIR}/${dir}/
[ -e "${dir}/opts.json" ] && mv ${dir}/opts.json ${LOCAL_LOGDIR}/${dir}/
done
popd
fi
source $CMS_BOT_DIR/jenkins-artifacts || true
send_jenkins_artifacts ${LOCAL_LOGDIR}/ ${LOG_DES}/ || true