aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2016-07-01 17:36:45 +0100
committerDaniel Lezcano <daniel.lezcano@linaro.org>2016-07-01 17:36:45 +0100
commit7ad1150d7994633d45e67d663af95fb52326b879 (patch)
tree8d31a570bd3db3143db9670effa70c97750e52b0
parentde5b633a95d933802f34093d8f202656457f460e (diff)
parent6f23ebd171c2c2bdfa9538d0e7e38868aa5cf298 (diff)
Merge commit 'v0.2-11-g6f23ebd' into dpkg
-rwxr-xr-xpmwg-ci-blame14
-rwxr-xr-xpmwg-ci-integ10
-rwxr-xr-xpmwg-ci-report42
3 files changed, 48 insertions, 18 deletions
diff --git a/pmwg-ci-blame b/pmwg-ci-blame
index d6431ae..b96c291 100755
--- a/pmwg-ci-blame
+++ b/pmwg-ci-blame
@@ -5,7 +5,14 @@ FILE=$1
LINE=$2
ERROR=$3
-COMMIT_ID=$(git blame -L$LINE,$LINE $FILE | awk '{ print $1 }')
+# Generated files in the compilation directory won't be found
+# in the source tree, so instead of spitting an error, just ignore
+# the error/warning when the file is not found.
+if [ ! -f $FILE ]; then
+ exit 0
+fi
+
+COMMIT_ID=$(git annotate -L$LINE,$LINE $FILE | awk '{ print $1 }')
if [ "$COMMIT_ID" == "" ]; then
exit 1
fi
@@ -22,9 +29,6 @@ if [ $? -eq 0 ]; then
exit 0
fi
-echo $POWERCI_CONFIG
-
-
while read LINE; do
# ignore commented lines
@@ -46,6 +50,6 @@ if [ $FOUND -eq 1 ]; then
echo "The error/warning: $ERROR"
echo "... was introduced by commit:"
echo
-
git log -1 --pretty=medium $COMMIT_ID
+ echo
fi
diff --git a/pmwg-ci-integ b/pmwg-ci-integ
index 393d220..e2130eb 100755
--- a/pmwg-ci-integ
+++ b/pmwg-ci-integ
@@ -210,10 +210,12 @@ do_add_new() {
do_update_baseline() {
- TAG1=$(git describe --tags $(git rev-list --tags --max-count=1))
+ TAG1=$(git describe --tags $(git rev-list --tags=v* --max-count=1))
echo "Updating $BASELINE_BRANCH ..."
git remote update $BASELINE_BRANCH 2>&1
- TAG2=$(git describe --tags $(git rev-list --tags --max-count=1))
+ TAG2=$(git describe --tags $(git rev-list --tags=v* --max-count=1))
+
+ echo latest tag is $TAG2
if [ "$TAG1" != "$TAG2" ]; then
echo "$BASELINE_BRANCH has new tag $TAG2."
@@ -285,7 +287,7 @@ fi
########################################################
-TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
+TAG=$(git describe --tags $(git rev-list --tags=v* --max-count=1))
echo "Latest tag is $TAG"
echo "Check the 'integration' branch exists"
@@ -300,7 +302,7 @@ if [ $? -eq 0 ]; then
git branch -M $INTEG_BRANCH $INTEG_BRANCH_NEW_NAME
fi
-echo "Create a new integration branch"
+echo "Create a new integration branch based on $TAG"
git checkout -b $INTEG_BRANCH $TAG
echo "Merging topic branches..."
diff --git a/pmwg-ci-report b/pmwg-ci-report
index 6db226b..3916187 100755
--- a/pmwg-ci-report
+++ b/pmwg-ci-report
@@ -1,16 +1,37 @@
#!/bin/bash
-GIT_DESCR=$(git describe)
-KERNELCI_URL=https://kernelci.org/build/pwmg/kernel/$GIT_DESCR
+# 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}
+
+# Use pushd here so when the script exits, the CWD will automatically
+# be the initial one before calling this script.
+pushd $REPOPATH > /dev/null
+
+# 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/$GIT_DESCR/build-logs-summary.txt
+
BLAME_SCRIPT=pmwg-ci-blame
pmwg-ci_report() {
- URL=$KERNELCI_URL/$1
+ URL=$KERNELCI_URL
+
+ git tag | grep -q report-$GIT_DESCR && return 0
- echo "Downloading $URL ..."
+ ERRORS="$(curl -s -f $URL)"
+ if [ $? -ne 0 ]; then
+ return 1
+ fi
- curl -f $URL -o - | while read -r ERROR; do
+ echo "$ERRORS" | while read -r ERROR; do
# ignore commented lines
echo $ERROR | egrep -q '(^#|^\s*$|^\s*\t*#)' && continue
@@ -18,11 +39,14 @@ pmwg-ci_report() {
FILE=$(echo $ERROR | awk '{ print $2 }' | awk -F ':' '{print $1}')
LINE=$(echo $ERROR | awk '{ print $2 }' | awk -F ':' '{print $2}')
- echo "Investigating \"$ERROR\" ..."
+ # 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"
-
done
+
+ # Add a tag to the tree, so we now the report was already done.
+ git tag report-$GIT_DESCR
}
-pmwg-ci_report errors.txt
-pmwg-ci_report warnings.txt
+pmwg-ci_report