summaryrefslogtreecommitdiff
path: root/gitlab-ci
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-08 23:56:12 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-08 23:56:12 +0300
commit0620d28ff2d50838aef074eac752f8501d426337 (patch)
tree37b453a0ee5f49f934cf112ad9ea7756e0377582 /gitlab-ci
parent690b587d1693ebed5504731b091472c0f35d1bad (diff)
downloadevol-tools-0620d28ff2d50838aef074eac752f8501d426337.tar.gz
evol-tools-0620d28ff2d50838aef074eac752f8501d426337.tar.bz2
evol-tools-0620d28ff2d50838aef074eac752f8501d426337.tar.xz
evol-tools-0620d28ff2d50838aef074eac752f8501d426337.zip
gitlab-ci: show commit id in irc.
Diffstat (limited to 'gitlab-ci')
-rwxr-xr-xgitlab-ci/failaction.sh11
-rwxr-xr-xgitlab-ci/susseccaction.sh13
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