summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorStanda Opichal <opichals@gmail.com>2015-02-18 15:47:10 +0100
committerStanda Opichal <opichals@gmail.com>2015-02-19 13:11:10 +0100
commit008e3d66e9649079037260c072020340c69f3eec (patch)
tree5845980127104dce7d8325cecaf671812b8009d8 /app/models
parent0b8e41aae2d6d64d18d8034e863e72cc832d0b83 (diff)
downloadgitlab-ce-008e3d66e9649079037260c072020340c69f3eec.tar.gz
Fix for TeamCity buildQueue REST API build/@branchName.
Strips the refs/heads/ if any to get just the branchName out of a :ref e.g.: `refs/heads/feature/newProfile` -> `feature/newProfile` The TeamCity buildQueue POST data require the branchName attribute to contain just the branch name (just xyzbranch and not the full ref in the refs/heads/xyzbranch). With the refs/heads/xyzbranch the build is triggered and looks like it is working however it always ompiles the default branch (or master).
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project_services/teamcity_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/project_services/teamcity_service.rb b/app/models/project_services/teamcity_service.rb
index c4b6ef5d9a9..b6932f1c77b 100644
--- a/app/models/project_services/teamcity_service.rb
+++ b/app/models/project_services/teamcity_service.rb
@@ -115,13 +115,13 @@ class TeamcityService < CiService
end
end
- def execute(data)
+ def execute(push)
auth = {
username: username,
password: password,
}
- branch = data[:ref]
+ branch = push[:ref].gsub('refs/heads/', '')
self.class.post("#{teamcity_url}/httpAuth/app/rest/buildQueue",
body: "<build branchName=\"#{branch}\">"\