summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-02-03 14:37:17 +0100
committerJames Lopez <james@jameslopez.es>2016-02-03 14:37:17 +0100
commit059d82637b5ab046c727df9a8150a6903ef32681 (patch)
tree31de944a1352d74d54914ef38b4d5b53731ab606 /lib
parent494028445b2d63fbcb62b1ddc8260574e374505c (diff)
downloadgitlab-ce-059d82637b5ab046c727df9a8150a6903ef32681.tar.gz
update ci configuration to send slack notifications on failure and added rake task
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/ci/slack.rake9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/tasks/ci/slack.rake b/lib/tasks/ci/slack.rake
new file mode 100644
index 00000000000..c4edda466ac
--- /dev/null
+++ b/lib/tasks/ci/slack.rake
@@ -0,0 +1,9 @@
+namespace :ci do
+ namespace :slack do
+ desc "GitLab CI | Send slack notification on build failure"
+ task error: :environment do
+ error_text = 'Build failed for master/tags'
+ Kernel.system "curl -X POST --data-urlencode 'payload={\"channel\": \"#ci-test\", \"username\": \"gitlab-ci\", \"text\": \"#{error_text}\", \"icon_emoji\": \":gitlab:\"}' $CI_SLACK_WEBHOOK_URL"
+ end
+ end
+end