diff options
author | Stan Hu <stanhu@gmail.com> | 2015-02-19 05:02:57 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-03-03 11:14:31 +0100 |
commit | afe5d7d209a4088d71e35d6382e6523b89f94ebe (patch) | |
tree | a3432580bee64e1c9f30b0815426c31e3220d021 /app/models/project_services/teamcity_service.rb | |
parent | 2f4656b5c7e2a9b351237432e76a7b928a1684b1 (diff) | |
download | gitlab-ce-afe5d7d209a4088d71e35d6382e6523b89f94ebe.tar.gz |
Issue #595: Support Slack notifications upon issue and merge request events
1) Adds a DB migration for all services to toggle on push, issue, and merge events.
2) Upon an issue or merge request event, fire service hooks.
3) Slack service supports custom messages for each of these events. Other services
not supported at the moment.
4) Label merge request hooks with their corresponding actions.
Diffstat (limited to 'app/models/project_services/teamcity_service.rb')
-rw-r--r-- | app/models/project_services/teamcity_service.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/models/project_services/teamcity_service.rb b/app/models/project_services/teamcity_service.rb index b6932f1c77b..07facfb6d06 100644 --- a/app/models/project_services/teamcity_service.rb +++ b/app/models/project_services/teamcity_service.rb @@ -11,6 +11,10 @@ # active :boolean default(FALSE), not null # properties :text # template :boolean default(FALSE) +# push_events :boolean default(TRUE) +# issues_events :boolean default(TRUE) +# merge_requests_events :boolean default(TRUE) +# tag_push_events :boolean default(TRUE) # class TeamcityService < CiService @@ -115,13 +119,16 @@ class TeamcityService < CiService end end - def execute(push) + def execute(data) + object_kind = data[:object_kind] + return unless object_kind == "push" + auth = { username: username, password: password, } - branch = push[:ref].gsub('refs/heads/', '') + branch = data[:ref].gsub('refs/heads/', '') self.class.post("#{teamcity_url}/httpAuth/app/rest/buildQueue", body: "<build branchName=\"#{branch}\">"\ |