buildkiterb 0.2.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.env.example +2 -1
  3. data/.github/FUNDING.yml +1 -3
  4. data/.github/workflows/ci.yml +2 -2
  5. data/Gemfile +3 -1
  6. data/Gemfile.lock +5 -3
  7. data/README.md +110 -39
  8. data/bin/console +4 -1
  9. data/lib/buildkite/client.rb +54 -53
  10. data/lib/buildkite/configuration.rb +11 -0
  11. data/lib/buildkite/models/access_token.rb +18 -0
  12. data/lib/buildkite/models/agent.rb +23 -0
  13. data/lib/buildkite/models/annotation.rb +14 -0
  14. data/lib/buildkite/models/artifact.rb +33 -0
  15. data/lib/buildkite/models/build.rb +44 -0
  16. data/lib/buildkite/models/cluster.rb +34 -0
  17. data/lib/buildkite/models/cluster_queue.rb +44 -0
  18. data/lib/buildkite/models/cluster_token.rb +34 -0
  19. data/lib/buildkite/models/emoji.rb +14 -0
  20. data/lib/buildkite/models/job.rb +33 -0
  21. data/lib/buildkite/models/organization.rb +19 -0
  22. data/lib/buildkite/models/pipeline.rb +48 -0
  23. data/lib/buildkite/models/user.rb +14 -0
  24. data/lib/buildkite/version.rb +1 -1
  25. data/lib/buildkite.rb +32 -28
  26. metadata +20 -27
  27. data/lib/buildkite/objects/access_token.rb +0 -4
  28. data/lib/buildkite/objects/agent.rb +0 -4
  29. data/lib/buildkite/objects/annotation.rb +0 -4
  30. data/lib/buildkite/objects/artifact.rb +0 -4
  31. data/lib/buildkite/objects/build.rb +0 -4
  32. data/lib/buildkite/objects/emoji.rb +0 -4
  33. data/lib/buildkite/objects/job.rb +0 -4
  34. data/lib/buildkite/objects/organization.rb +0 -4
  35. data/lib/buildkite/objects/pipeline.rb +0 -4
  36. data/lib/buildkite/objects/user.rb +0 -4
  37. data/lib/buildkite/resource.rb +0 -59
  38. data/lib/buildkite/resources/access_token.rb +0 -13
  39. data/lib/buildkite/resources/agents.rb +0 -18
  40. data/lib/buildkite/resources/annotations.rb +0 -10
  41. data/lib/buildkite/resources/artifacts.rb +0 -27
  42. data/lib/buildkite/resources/builds.rb +0 -36
  43. data/lib/buildkite/resources/emojis.rb +0 -10
  44. data/lib/buildkite/resources/jobs.rb +0 -25
  45. data/lib/buildkite/resources/organizations.rb +0 -14
  46. data/lib/buildkite/resources/pipelines.rb +0 -39
  47. data/lib/buildkite/resources/user.rb +0 -9
  48. /data/lib/buildkite/{objects → models}/artifact_download.rb +0 -0
  49. /data/lib/buildkite/{objects → models}/job_env.rb +0 -0
  50. /data/lib/buildkite/{objects → models}/job_log.rb +0 -0
@@ -1,25 +0,0 @@
1
- module Buildkite
2
- class JobsResource < Resource
3
-
4
- def retry(org:, pipeline:, number:, job:)
5
- Job.new put_request("organizations/#{org}/pipelines/#{pipeline}/builds/#{number}/jobs/#{job}/retry", body: {}).body
6
- end
7
-
8
- def unblock(org:, pipeline:, number:, job:, **args)
9
- Job.new put_request("organizations/#{org}/pipelines/#{pipeline}/builds/#{number}/jobs/#{job}/unblock", body: args).body
10
- end
11
-
12
- def log(org:, pipeline:, number:, job:)
13
- JobLog.new get_request("organizations/#{org}/pipelines/#{pipeline}/builds/#{number}/jobs/#{job}/log").body
14
- end
15
-
16
- def delete_log(org:, pipeline:, number:, job:)
17
- delete_request("organizations/#{org}/pipelines/#{pipeline}/builds/#{number}/jobs/#{job}/log")
18
- end
19
-
20
- def env(org:, pipeline:, number:, job:)
21
- JobEnv.new get_request("organizations/#{org}/pipelines/#{pipeline}/builds/#{number}/jobs/#{job}/env").body["env"]
22
- end
23
-
24
- end
25
- end
@@ -1,14 +0,0 @@
1
- module Buildkite
2
- class OrganizationsResource < Resource
3
-
4
- def list
5
- response = get_request("organizations")
6
- Collection.from_response(response, type: Organization)
7
- end
8
-
9
- def get(slug:)
10
- Organization.new get_request("organizations/#{slug}").body
11
- end
12
-
13
- end
14
- end
@@ -1,39 +0,0 @@
1
- module Buildkite
2
- class PipelinesResource < Resource
3
-
4
- def list(org:)
5
- response = get_request("organizations/#{org}/pipelines")
6
- Collection.from_response(response, type: Pipeline)
7
- end
8
-
9
- def get(org:, slug:)
10
- Pipeline.new get_request("organizations/#{org}/pipelines/#{slug}").body
11
- end
12
-
13
- def create(org:, name:, repository:, configuration:, **args)
14
- data = {name: name, repository: repository, configuration: configuration}
15
- Pipeline.new post_request("organizations/#{org}/pipelines", body: data.merge(args)).body
16
- end
17
-
18
- def update(org:, slug:, **args)
19
- Pipeline.new patch_request("organizations/#{org}/pipelines/#{slug}", body: args).body
20
- end
21
-
22
- def archive(org:, slug:)
23
- Pipeline.new post_request("organizations/#{org}/pipelines/#{slug}/archive", body: {}).body
24
- end
25
-
26
- def unarchive(org:, slug:)
27
- Pipeline.new post_request("organizations/#{org}/pipelines/#{slug}/unarchive", body: {}).body
28
- end
29
-
30
- def delete(org:, slug:)
31
- delete_request("organizations/#{org}/pipelines/#{slug}")
32
- end
33
-
34
- def webhook(org:, slug:)
35
- post_request("organizations/#{org}/pipelines/#{slug}/webhook", body: {})
36
- end
37
-
38
- end
39
- end
@@ -1,9 +0,0 @@
1
- module Buildkite
2
- class UserResource < Resource
3
-
4
- def get
5
- User.new get_request("user").body
6
- end
7
-
8
- end
9
- end
File without changes
File without changes