Class: CIRunner::Client::AuthenticatedBuildkite
- Defined in:
- lib/ci_runner/client/authenticated_buildkite.rb
Overview
Client used to retrieve private Resources on buildkite.
For public resources, the API can be used but only a limited number of users will be be able to access it as it requires a token scoped for the organization (most users working on opensource project aren’t member of the organization they contribute to).
Constant Summary collapse
- API_ENDPOINT =
"api.buildkite.com"
Instance Method Summary collapse
-
#access_token ⇒ Hash
Get information about an access token.
- #download_log(url) ⇒ StringIO
-
#job_logs(org, pipeline, number) ⇒ Array<String>
Retrieve URLs to download job logs for all steps.
Methods inherited from Base
default_client, #initialize, #reset!
Constructor Details
This class inherits a constructor from CIRunner::Client::Base
Instance Method Details
#access_token ⇒ Hash
Get information about an access token. Used to check if the token has the correct scopes.
51 52 53 |
# File 'lib/ci_runner/client/authenticated_buildkite.rb', line 51 def access_token get("/v2/access-token") end |
#download_log(url) ⇒ StringIO
42 43 44 |
# File 'lib/ci_runner/client/authenticated_buildkite.rb', line 42 def download_log(url) StringIO.new(get(url)) end |
#job_logs(org, pipeline, number) ⇒ Array<String>
Retrieve URLs to download job logs for all steps.
29 30 31 32 33 34 35 |
# File 'lib/ci_runner/client/authenticated_buildkite.rb', line 29 def job_logs(org, pipeline, number) build = get("/v2/organizations/#{org}/pipelines/#{pipeline}/builds/#{number}") build["jobs"].map do |job| job["raw_log_url"] end end |