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
84b35507
Commit
84b35507
authored
May 14, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Jenkins CI service
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
48311f05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
0 deletions
+60
-0
app/models/project.rb
app/models/project.rb
+8
-0
app/models/project_services/jenkins_service.rb
app/models/project_services/jenkins_service.rb
+52
-0
No files found.
app/models/project.rb
View file @
84b35507
...
...
@@ -56,6 +56,8 @@ class Project < ActiveRecord::Base
has_one
:git_hook
,
dependent: :destroy
has_one
:last_event
,
->
{
order
'events.created_at DESC'
},
class_name:
'Event'
,
foreign_key:
'project_id'
# Project services
has_one
:gitlab_ci_service
,
dependent: :destroy
has_one
:campfire_service
,
dependent: :destroy
has_one
:emails_on_push_service
,
dependent: :destroy
...
...
@@ -66,6 +68,8 @@ class Project < ActiveRecord::Base
has_one
:gemnasium_service
,
dependent: :destroy
has_one
:slack_service
,
dependent: :destroy
has_one
:jira_service
,
dependent: :destroy
has_one
:jenkins_service
,
dependent: :destroy
has_one
:forked_project_link
,
dependent: :destroy
,
foreign_key:
"forked_to_project_id"
has_one
:forked_from_project
,
through: :forked_project_link
# Merge Requests for target project should be removed with it
...
...
@@ -318,7 +322,11 @@ class Project < ActiveRecord::Base
end
def
available_services_names
<<<<<<<
HEAD
%w(gitlab_ci campfire hipchat pivotaltracker flowdock assembla emails_on_push gemnasium slack jira)
=======
%w(gitlab_ci campfire hipchat pivotaltracker flowdock assembla emails_on_push gemnasium slack jenkins)
>>>>>>>
Add
Jenkins
CI
service
end
def
gitlab_ci?
...
...
app/models/project_services/jenkins_service.rb
0 → 100644
View file @
84b35507
# == Schema Information
#
# Table name: services
#
# id :integer not null, primary key
# type :string(255)
# title :string(255)
# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
# project_url :string(255)
# subdomain :string(255)
# room :string(255)
# recipients :text
# api_key :string(255)
#
class
JenkinsService
<
Service
attr_accessible
:project_url
validates
:project_url
,
presence:
true
,
if: :activated?
delegate
:execute
,
to: :service_hook
,
prefix:
nil
after_save
:compose_service_hook
,
if: :activated?
def
compose_service_hook
hook
=
service_hook
||
build_service_hook
hook
.
url
=
[
project_url
,
"/gitlab/build_now"
].
join
(
""
)
hook
.
save
end
def
title
'Jenkins CI'
end
def
description
'An extendable open source continuous integration server'
end
def
to_param
'jenkins'
end
def
fields
[
{
type:
'text'
,
name:
'project_url'
,
placeholder:
'Jenkins server URL like http://jenkins.example.com/'
}
]
end
end
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