diff options
author | Keith Wansbrough <keithw@lochan.org> | 2018-01-18 06:13:24 +0000 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2018-01-18 07:13:24 +0100 |
commit | bdb6d63d4f7423e80e51350546698764994f08c8 (patch) | |
tree | 70a831cf375b7abb5e3971546da753a8b122de94 /docs | |
parent | 5149651fb4d21dabfde012238abad470bb0aa9b5 (diff) | |
download | gitlab-bdb6d63d4f7423e80e51350546698764994f08c8.tar.gz |
Add manager for jobs within a pipeline. (#413)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/gl_objects/builds.py | 12 | ||||
-rw-r--r-- | docs/gl_objects/builds.rst | 18 |
2 files changed, 24 insertions, 6 deletions
diff --git a/docs/gl_objects/builds.py b/docs/gl_objects/builds.py index ba4b22b..a5d2005 100644 --- a/docs/gl_objects/builds.py +++ b/docs/gl_objects/builds.py @@ -55,10 +55,18 @@ commit = gl.project_commits.get(commit_sha, project_id=1) 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() diff --git a/docs/gl_objects/builds.rst b/docs/gl_objects/builds.rst index 1c95eb1..b0f3e22 100644 --- a/docs/gl_objects/builds.rst +++ b/docs/gl_objects/builds.rst @@ -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 --------- @@ -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: |