Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
afe1ff41
Commit
afe1ff41
authored
May 15, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specify project URL for Jenkins service
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
b16d77c3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
app/models/project.rb
app/models/project.rb
+1
-1
app/models/project_services/jenkins_service.rb
app/models/project_services/jenkins_service.rb
+4
-3
No files found.
app/models/project.rb
View file @
afe1ff41
...
@@ -335,7 +335,7 @@ class Project < ActiveRecord::Base
...
@@ -335,7 +335,7 @@ class Project < ActiveRecord::Base
end
end
def
ci_service
def
ci_service
services
.
select
(
&
:activated?
).
first
@ci_service
||=
services
.
select
(
&
:activated?
).
first
end
end
def
jira_tracker?
def
jira_tracker?
...
...
app/models/project_services/jenkins_service.rb
View file @
afe1ff41
...
@@ -28,7 +28,8 @@ class JenkinsService < CiService
...
@@ -28,7 +28,8 @@ class JenkinsService < CiService
def
compose_service_hook
def
compose_service_hook
hook
=
service_hook
||
build_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
hook
.
save
end
end
...
@@ -46,12 +47,12 @@ class JenkinsService < CiService
...
@@ -46,12 +47,12 @@ class JenkinsService < CiService
def
fields
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
end
def
build_page
sha
def
build_page
sha
project_url
+
"/
job/test1/
scm/bySHA1/
#{
sha
}
"
project_url
+
"/scm/bySHA1/
#{
sha
}
"
end
end
def
commit_status
sha
def
commit_status
sha
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment