diff options
author | Aníbal Limón <anibal.limon@linaro.org> | 2018-05-14 13:21:34 -0500 |
---|---|---|
committer | Anibal Limon <anibal.limon@linaro.org> | 2018-05-16 14:40:57 +0000 |
commit | d05669d62bc6d78c4e22a234ad86a1f3fc921c03 (patch) | |
tree | 97e1e57128a23669f4fe127bcf7f000ae68c8ff5 /lt-qcom-linux-automerge | |
parent | 76e91cca1fe311e8e524c6f1084cc8675391c9a9 (diff) |
lt-qcom-linux-automerge: Add pre-send email groovy script
In order to fix multiline variables, replace the message content
using groovy.
Change-Id: I4ebefd5cd3e75ec11d279166af375ff6f1cba2b3
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
Diffstat (limited to 'lt-qcom-linux-automerge')
-rwxr-xr-x | lt-qcom-linux-automerge/builders.sh | 4 | ||||
-rw-r--r-- | lt-qcom-linux-automerge/presend-script.groovy | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lt-qcom-linux-automerge/builders.sh b/lt-qcom-linux-automerge/builders.sh index 63436cdd..e4497c11 100755 --- a/lt-qcom-linux-automerge/builders.sh +++ b/lt-qcom-linux-automerge/builders.sh @@ -91,13 +91,13 @@ EOF export CONFIG_PATH=${AUTOMERGE_PATH}/automerge-ci.conf fi -AUTOMERGE_CONFIG=$(sed ':a;N;$!ba;s/\n/\\\\n/g' ${CONFIG_PATH}) +AUTOMERGE_CONFIG=$(sed ':a;N;$!ba;s/\n/\\n/g' ${CONFIG_PATH}) # * Disable exit when fail to collect build logs set +e yes | ci-merge -l ${INTEGRATION_REPO_PATH} -r ${INTEGRATION_REPO_URL} -i ${INTEGRATION_BRANCH} -c ${RERERE_REPO_URL} | tee automerge.log AUTOMERGE_EXIT_CODE=$? -AUTOMERGE_BRANCH_FAILED=$(grep 'Merge failed' automerge.log | sed ':a;N;$!ba;s/\n/\\\\n/g') +AUTOMERGE_BRANCH_FAILED=$(grep 'Merge failed' automerge.log | sed ':a;N;$!ba;s/\n/\\n/g') set -e popd diff --git a/lt-qcom-linux-automerge/presend-script.groovy b/lt-qcom-linux-automerge/presend-script.groovy new file mode 100644 index 00000000..0b9f2bd3 --- /dev/null +++ b/lt-qcom-linux-automerge/presend-script.groovy @@ -0,0 +1,5 @@ +automerge_config = sprintf(build.envVars["AUTOMERGE_CONFIG"]) +automerge_branch_failed = sprintf(build.envVars["AUTOMERGE_BRANCH_FAILED"]) + +msg.setContent(msg.getContent().replace("{{AUTOMERGE_CONFIG}}", automerge_config), 'text/plain') +msg.setContent(msg.getContent().replace("{{AUTOMERGE_BRANCH_FAILED}}", automerge_branch_failed), 'text/plain') |