Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add manager for jobs within a pipeline.#413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall 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
12 changes: 10 additions & 2 deletionsdocs/gl_objects/builds.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -55,10 +55,18 @@
builds = commit.builds()
# end commit list

# get
# pipeline list get
# v4 only
project = gl.projects.get(project_id)
pipeline = project.pipelines.get(pipeline_id)
jobs = pipeline.jobs.list() # gets all jobs in pipeline
job = pipeline.jobs.get(job_id) # gets one job from pipeline
# end pipeline list get

# get job
project.builds.get(build_id) # v3
project.jobs.get(job_id) # v4
# end get
# end get job

# artifacts
build_or_job.artifacts()
Expand Down
18 changes: 14 additions & 4 deletionsdocs/gl_objects/builds.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -122,8 +122,9 @@ Remove a variable:
Builds/Jobs
===========

Builds/Jobs are associated to projects and commits. They provide information on
the builds/jobs that have been run, and methods to manipulate them.
Builds/Jobs are associated to projects, pipelines and commits. They provide
information on the builds/jobs that have been run, and methods to manipulate
them.

Reference
---------
Expand DownExpand Up@@ -169,11 +170,20 @@ To list builds for a specific commit, create a
:start-after: # commit list
:end-before: # end commit list

To list builds for a specific pipeline or get a single job within a specific
pipeline, create a
:class:`~gitlab.v4.objects.ProjectPipeline` object and use its
:attr:`~gitlab.v4.objects.ProjectPipeline.jobs` method (v4 only):

.. literalinclude:: builds.py
:start-after: # pipeline list get
:end-before: # end pipeline list get

Get a job:

.. literalinclude:: builds.py
:start-after: # get
:end-before: # end get
:start-after: # get job
:end-before: # end get job

Get a job artifact:

Expand Down
12 changes: 12 additions & 0 deletionsgitlab/v4/objects.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1883,6 +1883,8 @@ def raw(self, file_path, ref, streamed=False, action=None, chunk_size=1024,


class ProjectPipeline(RESTObject):
_managers = (('jobs', 'ProjectPipelineJobManager'), )

@cli.register_custom_action('ProjectPipeline')
@exc.on_http_error(exc.GitlabPipelineCancelError)
def cancel(self, **kwargs):
Expand DownExpand Up@@ -1940,6 +1942,16 @@ def create(self, data, **kwargs):
return CreateMixin.create(self, data, path=path, **kwargs)


class ProjectPipelineJob(ProjectJob):
pass


class ProjectPipelineJobManager(GetFromListMixin, RESTManager):
_path = '/projects/%(project_id)s/pipelines/%(pipeline_id)s/jobs'
_obj_cls = ProjectPipelineJob
_from_parent_attrs = {'project_id': 'project_id', 'pipeline_id': 'id'}


class ProjectSnippetNoteAwardEmoji(ObjectDeleteMixin, RESTObject):
pass

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp