aboutsummaryrefslogtreecommitdiff
path: root/ci-report
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@free.fr>2018-03-28 12:03:54 +0200
committerDaniel Lezcano <daniel.lezcano@free.fr>2018-03-28 12:03:54 +0200
commitde7763f47c749a39a7befa98b9c3086fb74fe5ab (patch)
tree90428743f0f79a106ce2b39debfccffd5036b5b0 /ci-report
parentd7eebfc48bc1f56561983696698347e30995dc5c (diff)
As we will share the scripts with everyone in Linaro, let change the name
to a more generic one. Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
Diffstat (limited to 'ci-report')
-rwxr-xr-xci-report59
1 files changed, 59 insertions, 0 deletions
diff --git a/ci-report b/ci-report
new file mode 100755
index 0000000..3e89c2e
--- /dev/null
+++ b/ci-report
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+# Give the opportunity the caller of the script to specify the directory
+# where the repository is located, otherwise default to the current
+# directory
+REPOPATH=${1:-$PWD}
+
+# Move into the repo
+cd $REPOPATH
+
+# kernelci is using abbrev=12 inherited from Jenkins
+ABBREV=12
+
+# Get the git description conforming to kernelci
+GIT_DESCR=$(git describe --abbrev=$ABBREV)
+# Build the url
+KERNELCI_URL=https://storage.kernelci.org/pmwg/integ/$GIT_DESCR/build-logs-summary.txt
+
+BLAME_SCRIPT=ci-blame
+
+ci_report() {
+
+ URL=$KERNELCI_URL
+
+ git tag | grep -q report-$GIT_DESCR && return 1
+
+ ERRORS="$(curl -s -f $URL)"
+ if [ $? -ne 0 ]; then
+ return 1
+ fi
+
+ RET=0
+ echo "$ERRORS" | while read -r ERROR; do
+
+ # ignore commented lines
+ echo $ERROR | egrep -q '(^#|^\s*$|^\s*\t*#)' && continue
+
+ FILE=$(echo $ERROR | awk '{ print $2 }' | awk -F ':' '{print $1}')
+ LINE=$(echo $ERROR | awk '{ print $2 }' | awk -F ':' '{print $2}')
+
+ # Do not display anything, so if there is no warning/error belonging
+ # to one of *our* branch, then we end up with nothing on the input, so
+ # nothing on the email report => everything ok.
+ $BLAME_SCRIPT $FILE $LINE "$ERROR"
+ RET=$(( RET + $? ))
+ done
+
+ # Add a tag to the tree, so we know that the branch can't be tested
+ if [ $RET -ne 0]; then
+ git tag blame-$GIT_DESCR
+ fi
+
+ # Add a tag to the tree, so we know the report was already done.
+ git tag report-$GIT_DESCR
+
+ return $RET
+}
+
+ci_report