Module: Gitlab::Client::Builds
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/builds.rb
Overview
Defines methods related to builds.
Instance Method Summary collapse
-
#build(project, id) ⇒ Gitlab::ObjectifiedHash
Gets a single build.
-
#build_artifacts(project, id) ⇒ Gitlab::FileResponse
Gets build artifacts.
-
#build_cancel(project, id) ⇒ Gitlab::ObjectifiedHash
Cancels a build.
-
#build_erase(project, id) ⇒ Gitlab::ObjectifiedHash
Erase a single build of a project (remove build artifacts and a build trace).
-
#build_retry(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Retry a build.
-
#builds(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of project builds.
-
#commit_builds(project, sha, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of builds for specific commit in a project.
Instance Method Details
#build(project, id) ⇒ Gitlab::ObjectifiedHash
Gets a single build.
29 30 31 |
# File 'lib/gitlab/client/builds.rb', line 29 def build(project, id) get("/projects/#{url_encode project}/builds/#{id}") end |
#build_artifacts(project, id) ⇒ Gitlab::FileResponse
Gets build artifacts.
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/gitlab/client/builds.rb', line 41 def build_artifacts(project, id) get("/projects/#{url_encode project}/builds/#{id}/artifacts", format: nil, headers: { Accept: 'application/octet-stream' }, parser: proc { |body, _| if body.encoding == Encoding::ASCII_8BIT # binary response ::Gitlab::FileResponse.new StringIO.new(body, 'rb+') else # error with json response ::Gitlab::Request.parse(body) end }) end |
#build_cancel(project, id) ⇒ Gitlab::ObjectifiedHash
Cancels a build.
78 79 80 |
# File 'lib/gitlab/client/builds.rb', line 78 def build_cancel(project, id) post("/projects/#{url_encode project}/builds/#{id}/cancel") end |
#build_erase(project, id) ⇒ Gitlab::ObjectifiedHash
Erase a single build of a project (remove build artifacts and a build trace)
102 103 104 |
# File 'lib/gitlab/client/builds.rb', line 102 def build_erase(project, id) post("/projects/#{url_encode project}/builds/#{id}/erase") end |
#build_retry(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Retry a build.
90 91 92 |
# File 'lib/gitlab/client/builds.rb', line 90 def build_retry(project, id) post("/projects/#{url_encode project}/builds/#{id}/retry") end |
#builds(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of project builds.
17 18 19 |
# File 'lib/gitlab/client/builds.rb', line 17 def builds(project, ={}) get("/projects/#{url_encode project}/builds", query: ) end |
#commit_builds(project, sha, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of builds for specific commit in a project.
66 67 68 |
# File 'lib/gitlab/client/builds.rb', line 66 def commit_builds(project, sha, ={}) get("/projects/#{url_encode project}/repository/commits/#{sha}/builds", query: ) end |