Commit 102e9078 authored by Stan Hu's avatar Stan Hu

Grapify Jenkins and Jenkins Deprecated Service API

parent b0212aa4
......@@ -2,8 +2,8 @@ require 'uri'
class JenkinsDeprecatedService < CiService
prop_accessor :project_url
prop_accessor :multiproject_enabled
prop_accessor :pass_unstable
boolean_accessor :multiproject_enabled
boolean_accessor :pass_unstable
validates :project_url, presence: true, if: :activated?
......@@ -46,11 +46,11 @@ class JenkinsDeprecatedService < CiService
end
def multiproject_enabled?
self.multiproject_enabled == '1'
Gitlab::Utils.to_boolean(self.multiproject_enabled)
end
def pass_unstable?
self.pass_unstable == '1'
Gitlab::Utils.to_boolean(self.pass_unstable)
end
def build_page(sha, ref = nil)
......
......@@ -808,5 +808,41 @@ Get JetBrains TeamCity CI service settings for a project.
GET /projects/:id/services/teamcity
```
## Jenkins CI
A continuous integration and build server
### Create/Edit Jenkins CI service
Set Jenkins CI service for a project.
```
PUT /projects/:id/services/jenkins
```
Parameters:
- `jenkins_url` (**required**) - Jenkins URL like http://jenkins.example.com
- `project_name` (**required**) - The URL-friendly project name. Example: my_project_name
- `username` (**required**) - A user with permissions to trigger a manual build
- `password` (**required**)
### Delete Jenkins CI service
Delete Jenkins CI service for a project.
```
DELETE /projects/:id/services/jenkins
```
### Get Jenkins CI service settings
Get Jenkins CI service settings for a project.
```
GET /projects/:id/services/jenkins
```
[jira-doc]: ../project_services/jira.md
[old-jira-api]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-13-stable/doc/api/services.md#jira
......@@ -526,6 +526,53 @@ module API
type: String,
desc: 'The password of the user'
}
],
# EE-specific services
'jenkins' => [
{
required: true,
name: :jenkins_url,
type: String,
desc: 'Jenkins URL like http://jenkins.example.com'
},
{
required: true,
name: :project_name,
type: String,
desc: 'The URL-friendly project name. Example: my_project_name'
},
{
required: true,
name: :username,
type: String,
desc: 'The username with permissions to trigger a manual build'
},
{
required: true,
name: :password,
type: String,
desc: 'The password of the user'
}
],
'jenkins-deprecated' => [
{
required: true,
name: :project_url,
type: String,
desc: 'Jenkins project URL like http://jenkins.example.com/job/my-project/',
},
{
required: false,
name: :pass_unstable,
type: Boolean,
desc: 'Multi-project setup enabled?',
},
{
required: false,
name: :multiproject_enabled,
type: Boolean,
desc: 'hould unstable builds be treated as passing?'
}
]
}.freeze
......
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