gitlab 4.5.0 → 4.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/stale.yml +18 -0
- data/.rubocop_todo.yml +46 -0
- data/Gemfile +2 -0
- data/README.md +22 -22
- data/Rakefile +3 -5
- data/bin/console +1 -0
- data/exe/gitlab +5 -1
- data/gitlab.gemspec +9 -6
- data/lib/gitlab.rb +6 -3
- data/lib/gitlab/api.rb +5 -3
- data/lib/gitlab/cli.rb +11 -5
- data/lib/gitlab/cli_helpers.rb +31 -22
- data/lib/gitlab/client.rb +7 -8
- data/lib/gitlab/client/access_requests.rb +100 -93
- data/lib/gitlab/client/award_emojis.rb +127 -127
- data/lib/gitlab/client/boards.rb +82 -82
- data/lib/gitlab/client/branches.rb +89 -89
- data/lib/gitlab/client/build_variables.rb +117 -117
- data/lib/gitlab/client/builds.rb +98 -98
- data/lib/gitlab/client/commits.rb +154 -154
- data/lib/gitlab/client/deployments.rb +29 -29
- data/lib/gitlab/client/environments.rb +80 -80
- data/lib/gitlab/client/events.rb +54 -54
- data/lib/gitlab/client/group_milestones.rb +85 -86
- data/lib/gitlab/client/groups.rb +178 -178
- data/lib/gitlab/client/issues.rb +195 -196
- data/lib/gitlab/client/jobs.rb +150 -150
- data/lib/gitlab/client/keys.rb +14 -14
- data/lib/gitlab/client/labels.rb +79 -79
- data/lib/gitlab/client/merge_request_approvals.rb +102 -102
- data/lib/gitlab/client/merge_requests.rb +281 -256
- data/lib/gitlab/client/milestones.rb +85 -85
- data/lib/gitlab/client/namespaces.rb +18 -18
- data/lib/gitlab/client/notes.rb +260 -260
- data/lib/gitlab/client/pipeline_schedules.rb +123 -123
- data/lib/gitlab/client/pipeline_triggers.rb +93 -93
- data/lib/gitlab/client/pipelines.rb +62 -62
- data/lib/gitlab/client/projects.rb +526 -505
- data/lib/gitlab/client/repositories.rb +68 -55
- data/lib/gitlab/client/repository_files.rb +103 -103
- data/lib/gitlab/client/runners.rb +113 -115
- data/lib/gitlab/client/services.rb +46 -45
- data/lib/gitlab/client/sidekiq.rb +32 -32
- data/lib/gitlab/client/snippets.rb +86 -86
- data/lib/gitlab/client/system_hooks.rb +57 -57
- data/lib/gitlab/client/tags.rb +87 -88
- data/lib/gitlab/client/todos.rb +41 -41
- data/lib/gitlab/client/users.rb +242 -228
- data/lib/gitlab/client/versions.rb +16 -0
- data/lib/gitlab/configuration.rb +7 -5
- data/lib/gitlab/error.rb +3 -1
- data/lib/gitlab/file_response.rb +4 -2
- data/lib/gitlab/help.rb +9 -9
- data/lib/gitlab/objectified_hash.rb +5 -4
- data/lib/gitlab/page_links.rb +9 -7
- data/lib/gitlab/paginated_response.rb +14 -4
- data/lib/gitlab/request.rb +8 -5
- data/lib/gitlab/shell.rb +6 -4
- data/lib/gitlab/shell_history.rb +7 -5
- data/lib/gitlab/version.rb +3 -1
- metadata +8 -5
@@ -1,133 +1,133 @@
|
|
1
|
-
|
2
|
-
# Defines methods related to pipeline schedules.
|
3
|
-
# @see https://docs.gitlab.com/ce/api/pipeline_schedules.html
|
4
|
-
module PipelineSchedules
|
5
|
-
# Gets a list of project pipeline schedules.
|
6
|
-
#
|
7
|
-
# @example
|
8
|
-
# Gitlab.pipeline_schedules(5)
|
9
|
-
# Gitlab.pipeline_schedules(5, { scope: 'active' })
|
10
|
-
#
|
11
|
-
# @param [Integer, String] project the ID or name of a project.
|
12
|
-
# @param [Hash] options A customizable set of options.
|
13
|
-
# @options options [String] :scope The scope of pipeline schedules, one of a 'active' or 'inactive'.
|
14
|
-
# @return [Array<Gitlab::ObjectifiedHash>]
|
15
|
-
def pipeline_schedules(project, options={})
|
16
|
-
get("/projects/#{url_encode project}/pipeline_schedules", query: options)
|
17
|
-
end
|
1
|
+
# frozen_string_literal: true
|
18
2
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
3
|
+
# Defines methods related to pipeline schedules.
|
4
|
+
# @see https://docs.gitlab.com/ce/api/pipeline_schedules.html
|
5
|
+
module PipelineSchedules
|
6
|
+
# Gets a list of project pipeline schedules.
|
7
|
+
#
|
8
|
+
# @example
|
9
|
+
# Gitlab.pipeline_schedules(5)
|
10
|
+
# Gitlab.pipeline_schedules(5, { scope: 'active' })
|
11
|
+
#
|
12
|
+
# @param [Integer, String] project the ID or name of a project.
|
13
|
+
# @param [Hash] options A customizable set of options.
|
14
|
+
# @options options [String] :scope The scope of pipeline schedules, one of a 'active' or 'inactive'.
|
15
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
16
|
+
def pipeline_schedules(project, options = {})
|
17
|
+
get("/projects/#{url_encode project}/pipeline_schedules", query: options)
|
18
|
+
end
|
30
19
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
# @option options [Boolean] :active The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially (default: true).
|
43
|
-
# @return [Array<Gitlab::ObjectifiedHash>]
|
44
|
-
def create_pipeline_schedule(project, options={})
|
45
|
-
post("/projects/#{url_encode project}/pipeline_schedules", query: options)
|
46
|
-
end
|
20
|
+
# Gets a single pipeline schedule.
|
21
|
+
#
|
22
|
+
# @example
|
23
|
+
# Gitlab.pipeline_schedule(5, 3)
|
24
|
+
#
|
25
|
+
# @param [Integer, String] project The ID or name of a project.
|
26
|
+
# @param [Integer] id The ID of the pipeline schedule.
|
27
|
+
# @return [Gitlab::ObjectifiedHash]
|
28
|
+
def pipeline_schedule(project, id)
|
29
|
+
get("/projects/#{url_encode project}/pipeline_schedules/#{id}")
|
30
|
+
end
|
47
31
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
end
|
32
|
+
# Create a pipeline schedule.
|
33
|
+
#
|
34
|
+
# @example
|
35
|
+
# Gitlab.create_pipeline_schedule(5, { description: 'example' })
|
36
|
+
#
|
37
|
+
# @param [Integer, String] project The ID or name of a project.
|
38
|
+
# @param [Hash] options A customizable set of options.
|
39
|
+
# @option options [String] :description The description of pipeline scehdule.
|
40
|
+
# @option options [String] :ref The branch/tag name will be triggered.
|
41
|
+
# @option options [String] :cron The cron (e.g. 0 1 * * *).
|
42
|
+
# @option options [String] :cron_timezone The timezone supproted by ActiveSupport::TimeZone (e.g. Pacific Time (US & Canada)) (default: 'UTC').
|
43
|
+
# @option options [Boolean] :active The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially (default: true).
|
44
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
45
|
+
def create_pipeline_schedule(project, options = {})
|
46
|
+
post("/projects/#{url_encode project}/pipeline_schedules", query: options)
|
47
|
+
end
|
65
48
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
49
|
+
# Updates the pipeline schedule of a project.
|
50
|
+
#
|
51
|
+
# @example
|
52
|
+
# Gitlab.edit_pipeline_schedule(3, 2, { description: 'example2' })
|
53
|
+
#
|
54
|
+
# @param [Integer, String] project The ID or name of a project.
|
55
|
+
# @param [Integer] The pipeline schedule ID.
|
56
|
+
# @param [Hash] options A customizable set of options.
|
57
|
+
# @option options [String] :description The description of pipeline scehdule.
|
58
|
+
# @option options [String] :ref The branch/tag name will be triggered.
|
59
|
+
# @option options [String] :cron The cron (e.g. 0 1 * * *).
|
60
|
+
# @option options [String] :cron_timezone The timezone supproted by ActiveSupport::TimeZone (e.g. Pacific Time (US & Canada)) (default: 'UTC').
|
61
|
+
# @option options [Boolean] :active The activation of pipeline schedule. If false is set, the pipeline schedule will deactivated initially (default: true).
|
62
|
+
# @return [Array<Gitlab::ObjectifiedHash>] The updated pipeline schedule.
|
63
|
+
def edit_pipeline_schedule(project, pipeline_schedule_id, options = {})
|
64
|
+
put("/projects/#{url_encode project}/pipeline_schedules/#{pipeline_schedule_id}", query: options)
|
65
|
+
end
|
77
66
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
67
|
+
# Take ownership of a pipeline schedule.
|
68
|
+
#
|
69
|
+
# @example
|
70
|
+
# Gitlab.pipeline_schedule_take_ownership(5, 1)
|
71
|
+
#
|
72
|
+
# @param [Integer, String] project The ID or name of a project.
|
73
|
+
# @param [Integer] trigger_id The pipeline schedule ID.
|
74
|
+
# @return [Gitlab::ObjectifiedHash] The updated pipeline schedule.
|
75
|
+
def pipeline_schedule_take_ownership(project, pipeline_schedule_id)
|
76
|
+
post("/projects/#{url_encode project}/pipeline_schedules/#{pipeline_schedule_id}/take_ownership")
|
77
|
+
end
|
89
78
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
79
|
+
# Delete a pipeline schedule.
|
80
|
+
#
|
81
|
+
# @example
|
82
|
+
# Gitlab.delete_pipeline_schedule(5, 1)
|
83
|
+
#
|
84
|
+
# @param [Integer, String] project The ID or name of a project.
|
85
|
+
# @param [Integer] trigger_id The pipeline schedule ID.
|
86
|
+
# @return [Gitlab::ObjectifiedHash] The deleted pipeline schedule.
|
87
|
+
def delete_pipeline_schedule(project, pipeline_schedule_id)
|
88
|
+
delete("/projects/#{url_encode project}/pipeline_schedules/#{pipeline_schedule_id}")
|
89
|
+
end
|
90
|
+
|
91
|
+
# Create a pipeline schedule variable.
|
92
|
+
#
|
93
|
+
# @example
|
94
|
+
# Gitlab.create_pipeline_schedule_variable(5, 1, { key: 'foo', value: 'bar' })
|
95
|
+
#
|
96
|
+
# @param [Integer, String] project The ID or name of a project.
|
97
|
+
# @param [Integer] trigger_id The pipeline schedule ID.
|
98
|
+
# @param [Hash] options A customizable set of options.
|
99
|
+
# @option options [String] :key The key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed.
|
100
|
+
# @option options [String] :value The value of a variable
|
101
|
+
# @return [Array<Gitlab::ObjectifiedHash>] The created pipeline schedule variable.
|
102
|
+
def create_pipeline_schedule_variable(project, pipeline_schedule_id, options = {})
|
103
|
+
post("/projects/#{url_encode project}/pipeline_schedules/#{pipeline_schedule_id}/variables", query: options)
|
104
|
+
end
|
104
105
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
106
|
+
# Updates the variable of a pipeline schedule.
|
107
|
+
#
|
108
|
+
# @example
|
109
|
+
# Gitlab.edit_pipeline_schedule_variable(3, 2, "foo" { value: 'bar' })
|
110
|
+
#
|
111
|
+
# @param [Integer, String] project The ID or name of a project.
|
112
|
+
# @param [Integer] The pipeline schedule ID.
|
113
|
+
# @param [String] The key of a variable.
|
114
|
+
# @param [Hash] options A customizable set of options.
|
115
|
+
# @option options [String] :value The value of a variable.
|
116
|
+
# @return [Array<Gitlab::ObjectifiedHash>] The updated pipeline schedule variable.
|
117
|
+
def edit_pipeline_schedule_variable(project, pipeline_schedule_id, key, options = {})
|
118
|
+
put("/projects/#{url_encode project}/pipeline_schedules/#{pipeline_schedule_id}/variables/#{url_encode key}", query: options)
|
119
|
+
end
|
119
120
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
end
|
121
|
+
# Delete the variable of a pipeline schedule
|
122
|
+
#
|
123
|
+
# @example
|
124
|
+
# Gitlab.delete_pipeline_schedule_variable(3, 2, "foo")
|
125
|
+
#
|
126
|
+
# @param [Integer, String] project The ID or name of a project.
|
127
|
+
# @param [Integer] The pipeline schedule ID.
|
128
|
+
# @param [String] The key of a variable.
|
129
|
+
# @return [Array<Gitlab::ObjectifiedHash>] The deleted pipeline schedule variable.
|
130
|
+
def delete_pipeline_schedule_variable(project, pipeline_schedule_id, key, _options = {})
|
131
|
+
delete("/projects/#{url_encode project}/pipeline_schedules/#{pipeline_schedule_id}/variables/#{url_encode key}")
|
132
132
|
end
|
133
133
|
end
|
@@ -1,101 +1,101 @@
|
|
1
|
-
|
2
|
-
# Defines methods related to pipelines.
|
3
|
-
# @see https://docs.gitlab.com/ce/api/pipeline_triggers.html
|
4
|
-
# @see https://docs.gitlab.com/ce/ci/triggers/README.html
|
5
|
-
module PipelineTriggers
|
6
|
-
# Gets a list of the project's pipeline triggers
|
7
|
-
#
|
8
|
-
# @example
|
9
|
-
# Gitlab.triggers(5)
|
10
|
-
#
|
11
|
-
# @param [Integer, String] project The ID or name of a project.
|
12
|
-
# @return [Array<Gitlab::ObjectifiedHash>] The list of triggers.
|
13
|
-
def triggers(project)
|
14
|
-
get("/projects/#{url_encode project}/triggers")
|
15
|
-
end
|
1
|
+
# frozen_string_literal: true
|
16
2
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
3
|
+
# Defines methods related to pipelines.
|
4
|
+
# @see https://docs.gitlab.com/ce/api/pipeline_triggers.html
|
5
|
+
# @see https://docs.gitlab.com/ce/ci/triggers/README.html
|
6
|
+
module PipelineTriggers
|
7
|
+
# Gets a list of the project's pipeline triggers
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.triggers(5)
|
11
|
+
#
|
12
|
+
# @param [Integer, String] project The ID or name of a project.
|
13
|
+
# @return [Array<Gitlab::ObjectifiedHash>] The list of triggers.
|
14
|
+
def triggers(project)
|
15
|
+
get("/projects/#{url_encode project}/triggers")
|
16
|
+
end
|
28
17
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
18
|
+
# Gets details of project's pipeline trigger.
|
19
|
+
#
|
20
|
+
# @example
|
21
|
+
# Gitlab.trigger(5, 1)
|
22
|
+
#
|
23
|
+
# @param [Integer, String] project The ID or name of a project.
|
24
|
+
# @param [Integer] trigger_id The trigger ID.
|
25
|
+
# @return [Gitlab::ObjectifiedHash] The trigger.
|
26
|
+
def trigger(project, trigger_id)
|
27
|
+
get("/projects/#{url_encode project}/triggers/#{trigger_id}")
|
28
|
+
end
|
40
29
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
put("/projects/#{url_encode project}/triggers/#{trigger_id}", body: options)
|
53
|
-
end
|
30
|
+
# Create a pipeline trigger for a project.
|
31
|
+
#
|
32
|
+
# @example
|
33
|
+
# Gitlab.create_trigger(5, description: "my description")
|
34
|
+
#
|
35
|
+
# @param [Integer, String] project The ID or name of a project.
|
36
|
+
# @param [String] description The trigger name
|
37
|
+
# @return [Gitlab::ObjectifiedHash] The created trigger.
|
38
|
+
def create_trigger(project, description)
|
39
|
+
post("/projects/#{url_encode project}/triggers", body: { description: description })
|
40
|
+
end
|
54
41
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
42
|
+
# Update a project trigger
|
43
|
+
#
|
44
|
+
# @example
|
45
|
+
# Gitlab.update_trigger(5, 1, description: "my description")
|
46
|
+
#
|
47
|
+
# @param [Integer, String] project The ID or name of a project.
|
48
|
+
# @param [Integer] trigger_id The trigger ID.
|
49
|
+
# @param [Hash] options A customizable set of options.
|
50
|
+
# @option options [String] :description The trigger name.
|
51
|
+
# @return [Gitlab::ObjectifiedHash] The updated trigger.
|
52
|
+
def update_trigger(project, trigger_id, options = {})
|
53
|
+
put("/projects/#{url_encode project}/triggers/#{trigger_id}", body: options)
|
54
|
+
end
|
66
55
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
56
|
+
# Take ownership of a project trigger
|
57
|
+
#
|
58
|
+
# @example
|
59
|
+
# Gitlab.trigger_take_ownership(5, 1)
|
60
|
+
#
|
61
|
+
# @param [Integer, String] project The ID or name of a project.
|
62
|
+
# @param [Integer] trigger_id The trigger ID.
|
63
|
+
# @return [Gitlab::ObjectifiedHash] The updated trigger.
|
64
|
+
def trigger_take_ownership(project, trigger_id)
|
65
|
+
post("/projects/#{url_encode project}/triggers/#{trigger_id}/take_ownership")
|
66
|
+
end
|
67
|
+
|
68
|
+
# Remove a project's pipeline trigger.
|
69
|
+
#
|
70
|
+
# @example
|
71
|
+
# Gitlab.remove_trigger(5, 1)
|
72
|
+
#
|
73
|
+
# @param [Integer, String] project The ID or name of a project.
|
74
|
+
# @param [Integer] trigger_id The trigger ID.
|
75
|
+
# @return [void] This API call returns an empty response body.
|
76
|
+
def remove_trigger(project, trigger_id)
|
77
|
+
delete("/projects/#{url_encode project}/triggers/#{trigger_id}")
|
78
|
+
end
|
79
|
+
alias delete_trigger remove_trigger
|
79
80
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
end
|
81
|
+
# Run the given project pipeline trigger.
|
82
|
+
#
|
83
|
+
# @example
|
84
|
+
# Gitlab.run_trigger(5, '7b9148c158980bbd9bcea92c17522d', 'master')
|
85
|
+
# Gitlab.run_trigger(5, '7b9148c158980bbd9bcea92c17522d', 'master', { variable1: "value", variable2: "value2" })
|
86
|
+
#
|
87
|
+
# @see https://docs.gitlab.com/ce/ci/triggers/README.html
|
88
|
+
#
|
89
|
+
# @param [Integer, String] project The ID or name of the project.
|
90
|
+
# @param [String] token The token of a trigger.
|
91
|
+
# @param [String] ref Branch or tag name to build.
|
92
|
+
# @param [Hash] variables A set of build variables to use for the build. (optional)
|
93
|
+
# @return [Gitlab::ObjectifiedHash] The trigger.
|
94
|
+
def run_trigger(project, token, ref, variables = {})
|
95
|
+
post("/projects/#{url_encode project}/trigger/pipeline", unauthenticated: true, body: {
|
96
|
+
token: token,
|
97
|
+
ref: ref,
|
98
|
+
variables: variables
|
99
|
+
})
|
100
100
|
end
|
101
101
|
end
|
@@ -1,68 +1,68 @@
|
|
1
|
-
|
2
|
-
# Defines methods related to pipelines.
|
3
|
-
# @see https://docs.gitlab.com/ce/api/pipelines.html
|
4
|
-
module Pipelines
|
5
|
-
# Gets a list of project pipelines.
|
6
|
-
#
|
7
|
-
# @example
|
8
|
-
# Gitlab.pipelines(5)
|
9
|
-
# Gitlab.pipelines(5, { per_page: 10, page: 2 })
|
10
|
-
#
|
11
|
-
# @param [Integer, String] project The ID or name of a project.
|
12
|
-
# @param [Hash] options A customizable set of options.
|
13
|
-
# @option options [Integer] :page The page number.
|
14
|
-
# @option options [Integer] :per_page The number of results per page.
|
15
|
-
# @return [Array<Gitlab::ObjectifiedHash>]
|
16
|
-
def pipelines(project, options={})
|
17
|
-
get("/projects/#{url_encode project}/pipelines", query: options)
|
18
|
-
end
|
1
|
+
# frozen_string_literal: true
|
19
2
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
3
|
+
# Defines methods related to pipelines.
|
4
|
+
# @see https://docs.gitlab.com/ce/api/pipelines.html
|
5
|
+
module Pipelines
|
6
|
+
# Gets a list of project pipelines.
|
7
|
+
#
|
8
|
+
# @example
|
9
|
+
# Gitlab.pipelines(5)
|
10
|
+
# Gitlab.pipelines(5, { per_page: 10, page: 2 })
|
11
|
+
#
|
12
|
+
# @param [Integer, String] project The ID or name of a project.
|
13
|
+
# @param [Hash] options A customizable set of options.
|
14
|
+
# @option options [Integer] :page The page number.
|
15
|
+
# @option options [Integer] :per_page The number of results per page.
|
16
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
17
|
+
def pipelines(project, options = {})
|
18
|
+
get("/projects/#{url_encode project}/pipelines", query: options)
|
19
|
+
end
|
31
20
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
21
|
+
# Gets a single pipeline.
|
22
|
+
#
|
23
|
+
# @example
|
24
|
+
# Gitlab.pipeline(5, 36)
|
25
|
+
#
|
26
|
+
# @param [Integer, String] project The ID or name of a project.
|
27
|
+
# @param [Integer] id The ID of a pipeline.
|
28
|
+
# @return [Gitlab::ObjectifiedHash]
|
29
|
+
def pipeline(project, id)
|
30
|
+
get("/projects/#{url_encode project}/pipelines/#{id}")
|
31
|
+
end
|
43
32
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
33
|
+
# Create a pipeline.
|
34
|
+
#
|
35
|
+
# @example
|
36
|
+
# Gitlab.create_pipeline(5, 'master')
|
37
|
+
#
|
38
|
+
# @param [Integer, String] project The ID or name of a project.
|
39
|
+
# @param [String] ref Reference to commit.
|
40
|
+
# @return [Gitlab::ObjectifiedHash] The pipelines changes.
|
41
|
+
def create_pipeline(project, ref)
|
42
|
+
post("/projects/#{url_encode project}/pipeline?ref=#{ref}")
|
43
|
+
end
|
44
|
+
|
45
|
+
# Cancels a pipeline.
|
46
|
+
#
|
47
|
+
# @example
|
48
|
+
# Gitlab.cancel_pipeline(5, 1)
|
49
|
+
#
|
50
|
+
# @param [Integer, String] project The ID or name of a project.
|
51
|
+
# @param [Integer] id The ID of a pipeline.
|
52
|
+
# @return [Gitlab::ObjectifiedHash] The pipelines changes.
|
53
|
+
def cancel_pipeline(project, id)
|
54
|
+
post("/projects/#{url_encode project}/pipelines/#{id}/cancel")
|
55
|
+
end
|
55
56
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
end
|
57
|
+
# Retry a pipeline.
|
58
|
+
#
|
59
|
+
# @example
|
60
|
+
# Gitlab.retry_pipeline(5, 1)
|
61
|
+
#
|
62
|
+
# @param [Integer, String] project The ID or name of a project.
|
63
|
+
# @param [Integer] id The ID of a pipeline.
|
64
|
+
# @return [Array<Gitlab::ObjectifiedHash>] The pipelines changes.
|
65
|
+
def retry_pipeline(project, id)
|
66
|
+
post("/projects/#{url_encode project}/pipelines/#{id}/retry")
|
67
67
|
end
|
68
68
|
end
|