Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/gl_objects/builds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Get a pipeline for a project::

pipeline = project.pipelines.get(pipeline_id)

Get variables of a pipeline::

variables = pipeline.variables.list()

Create a pipeline for a particular reference::

pipeline = project.pipelines.create({'ref': 'master'})
Expand Down
15 changes: 14 additions & 1 deletion gitlab/v4/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -3100,8 +3100,21 @@ class ProjectPipelineJobManager(ListMixin, RESTManager):
_list_filters = ("scope",)


class ProjectPipelineVariable(RESTObject):
_id_attr = "key"


class ProjectPipelineVariableManager(ListMixin, RESTManager):
_path = "/projects/%(project_id)s/pipelines/%(pipeline_id)s/variables"
_obj_cls = ProjectPipelineVariable
_from_parent_attrs = {"project_id": "project_id", "pipeline_id": "id"}


class ProjectPipeline(RESTObject, RefreshMixin, ObjectDeleteMixin):
_managers = (("jobs", "ProjectPipelineJobManager"),)
_managers = (
("jobs", "ProjectPipelineJobManager"),
("variables", "ProjectPipelineVariableManager"),
)

@cli.register_custom_action("ProjectPipeline")
@exc.on_http_error(exc.GitlabPipelineCancelError)
Expand Down