Commit afe1ff41 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Specify project URL for Jenkins service

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent b16d77c3
......@@ -335,7 +335,7 @@ class Project < ActiveRecord::Base
end
def ci_service
services.select(&:activated?).first
@ci_service ||= services.select(&:activated?).first
end
def jira_tracker?
......
......@@ -28,7 +28,8 @@ class JenkinsService < CiService
def compose_service_hook
hook = service_hook || build_service_hook
hook.url = [project_url, "/gitlab/build_now"].join("")
jenkins_url = project_url.sub(/job\/.*/, '')
hook.url = jenkins_url + "/gitlab/build_now"
hook.save
end
......@@ -46,12 +47,12 @@ class JenkinsService < CiService
def fields
[
{ type: 'text', name: 'project_url', placeholder: 'Jenkins server URL like http://jenkins.example.com/' }
{ type: 'text', name: 'project_url', placeholder: 'Jenkins project URL like http://jenkins.example.com/job/my-project/' }
]
end
def build_page sha
project_url + "/job/test1/scm/bySHA1/#{sha}"
project_url + "/scm/bySHA1/#{sha}"
end
def commit_status sha
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment