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.
31 32 33 |
# File 'lib/gitlab/client/builds.rb', line 31 def build(project, id) get("/projects/#{url_encode project}/builds/#{id}") end |
#build_artifacts(project, id) ⇒ Gitlab::FileResponse
Gets build artifacts.
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/gitlab/client/builds.rb', line 43 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.
80 81 82 |
# File 'lib/gitlab/client/builds.rb', line 80 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)
104 105 106 |
# File 'lib/gitlab/client/builds.rb', line 104 def build_erase(project, id) post("/projects/#{url_encode project}/builds/#{id}/erase") end |
#build_retry(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Retry a build.
92 93 94 |
# File 'lib/gitlab/client/builds.rb', line 92 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.
19 20 21 |
# File 'lib/gitlab/client/builds.rb', line 19 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.
68 69 70 |
# File 'lib/gitlab/client/builds.rb', line 68 def commit_builds(project, sha, = {}) get("/projects/#{url_encode project}/repository/commits/#{sha}/builds", query: ) end |