aboutsummaryrefslogtreecommitdiff
path: root/lt-qcom-linux-automerge
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linaro.org>2019-01-08 09:43:24 -0600
committerAníbal Limón <anibal.limon@linaro.org>2019-01-08 10:08:49 -0600
commitc76a35af176e8ec7d687a105cc42b45f08f0679f (patch)
tree5cdf23a92067c8e8f7c36a876e928a25f083d4cd /lt-qcom-linux-automerge
parent1862fc1fe44a06a1927a106d2033c6be7b08eabb (diff)
lt-qcom-linux-automerge: Fix/Improve ci-merge error detection
The ci-merge exit code was ignored due to use of tee, add disable pipefail to get the ci-merge exit code instead of tee. Add validation to be sure that the repo is clean before build and push the integration branch. Change-Id: I7a041ccc14bc31b5d26e6e990ff5b0bf8e4a0e49 Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
Diffstat (limited to 'lt-qcom-linux-automerge')
-rwxr-xr-xlt-qcom-linux-automerge/builders-kernel.sh7
-rwxr-xr-xlt-qcom-linux-automerge/builders.sh5
2 files changed, 11 insertions, 1 deletions
diff --git a/lt-qcom-linux-automerge/builders-kernel.sh b/lt-qcom-linux-automerge/builders-kernel.sh
index 48ece0cf..d0f453de 100755
--- a/lt-qcom-linux-automerge/builders-kernel.sh
+++ b/lt-qcom-linux-automerge/builders-kernel.sh
@@ -34,6 +34,13 @@ if [ ! -z "${AUTOMERGE_BRANCH_FAILED}" ]; then
exit 1
fi
+GIT_STATUS=$(git status -s)
+if [ ! -z "${GIT_STATUS}" ]; then
+ echo "ERROR: Automerge repository isn't clean,"
+ echo "${GIT_STATUS}"
+ exit 1
+fi
+
cd ${INTEGRATION_REPO_PATH}
build_integration_kernel "arm" "multi_v7_defconfig"
build_integration_kernel "arm64" "defconfig"
diff --git a/lt-qcom-linux-automerge/builders.sh b/lt-qcom-linux-automerge/builders.sh
index 01d251a6..1ced9bf7 100755
--- a/lt-qcom-linux-automerge/builders.sh
+++ b/lt-qcom-linux-automerge/builders.sh
@@ -93,10 +93,13 @@ fi
AUTOMERGE_CONFIG=$(sed ':a;N;$!ba;s/\n/\\n\\\n/g' ${CONFIG_PATH})
-# * Disable exit when fail to collect build logs
+# * Disable exit when fail to collect automerge_result_variables for builders-kernel.sh and email
+# * TODO: Add support in ci-merge to create a log (instead of use tee)
set +e
+set -o pipefail
yes | ci-merge -l ${INTEGRATION_REPO_PATH} -r ${INTEGRATION_REPO_URL} -i ${INTEGRATION_BRANCH} -c ${RERERE_REPO_URL} | tee automerge.log
AUTOMERGE_EXIT_CODE=$?
+set +o pipefail
AUTOMERGE_BRANCH_FAILED=$(grep 'Merge failed' automerge.log | sed ':a;N;$!ba;s/\n/\\n\\\n/g')
set -e
popd