diff options
-rwxr-xr-x | gitlab-ci/failaction.sh | 11 | ||||
-rwxr-xr-x | gitlab-ci/susseccaction.sh | 13 |
2 files changed, 15 insertions, 9 deletions
diff --git a/gitlab-ci/failaction.sh b/gitlab-ci/failaction.sh index 0d68247..a099a96 100755 --- a/gitlab-ci/failaction.sh +++ b/gitlab-ci/failaction.sh @@ -7,7 +7,10 @@ export nick="evolbuildbot" export buildid="$(cat clientdata/shared/buildid.log)" export error="$(cat clientdata/shared/error.log)" -export msg="Build failed. See https://gitlab.com/evol/clientdata/builds/${buildid}" +cd clientdata +export ghead=$(git log --pretty=oneline -n 1 | awk '{print $1}') +export gitcommit=$(echo ${ghead} | cut -c 1-7) +export msg="Build failed: ${gitcommit}. See https://gitlab.com/evol/clientdata/builds/${buildid}" echo "${msg}" @@ -22,12 +25,12 @@ sleep 10s echo ${msg} >${path}/${server}/${channel}/in if [[ -n "${error}" ]]; then sleep 2s - export LINK=$(pastebinit -b http://paste.ubuntu.com/ clientdata/shared/error.log) + export LINK=$(pastebinit -b http://paste.ubuntu.com/ shared/error.log) echo "Error log: ${LINK}" >${path}/${server}/${channel}/in fi sleep 3s -rm -rf clientdata/shared/buildid.log -rm -rf clientdata/shared/error.log +rm -rf shared/buildid.log +rm -rf shared/error.log killall ii diff --git a/gitlab-ci/susseccaction.sh b/gitlab-ci/susseccaction.sh index 4af7f6d..16edd68 100755 --- a/gitlab-ci/susseccaction.sh +++ b/gitlab-ci/susseccaction.sh @@ -7,8 +7,11 @@ export nick="evolbuildbot" export buildid="$(cat clientdata/shared/buildid.log)" export error="$(cat clientdata/shared/error.log)" -export msg1="Build success. See https://gitlab.com/evol/clientdata/builds/${buildid}" -export msg2="Build failed. See https://gitlab.com/evol/clientdata/builds/${buildid}" +cd clientdata +export ghead=$(git log --pretty=oneline -n 1 | awk '{print $1}') +export gitcommit=$(echo ${ghead} | cut -c 1-7) +export msg1="Build success: ${gitcommit}. See https://gitlab.com/evol/clientdata/builds/${buildid}" +export msg2="Build failed: ${gitcommit}. See https://gitlab.com/evol/clientdata/builds/${buildid}" echo "${msg}" @@ -23,7 +26,7 @@ sleep 10s if [[ -n "${error}" ]]; then echo ${msg2} >${path}/${server}/${channel}/in sleep 2s - export LINK=$(pastebinit -b http://paste.ubuntu.com/ clientdata/shared/error.log) + export LINK=$(pastebinit -b http://paste.ubuntu.com/ shared/error.log) echo "Error log: ${LINK}" >${path}/${server}/${channel}/in else echo ${msg1} >${path}/${server}/${channel}/in @@ -31,7 +34,7 @@ fi sleep 3s -rm -rf clientdata/shared/buildid.log -rm -rf clientdata/shared/error.log +rm -rf shared/buildid.log +rm -rf shared/error.log killall ii |