Module: Veyor
- Extended by:
- Configuration
- Defined in:
- lib/veyor/request.rb,
lib/veyor.rb,
lib/veyor/version.rb
Overview
veyor::Request
Class to perform HTTP requests to the Appveyor API
Defined Under Namespace
Classes: Request
Constant Summary collapse
- VERSION =
"0.3.0"
Class Method Summary collapse
-
.build_artifacts(job_id:, options: nil, verbose: false) ⇒ Array
List artifacts of a job.
-
.build_cancel(account: nil, project:, version:, options: nil, verbose: false) ⇒ Int
Cancel a build.
-
.build_delete(build_id:, options: nil, verbose: false) ⇒ Int
Delete a build.
-
.build_log(job_id:, options: nil, verbose: false) ⇒ Array
Download a build log.
-
.build_start(account: nil, project:, branch: 'master', options: nil, verbose: false) ⇒ Array
Start build of branch of most recent commit.
-
.environment_settings(id:, options: nil, verbose: false) ⇒ Array
Get environment settings.
-
.environments(options: nil, verbose: false) ⇒ Array
environments.
-
.project(account: nil, project: nil, branch: nil, version: nil, options: nil, verbose: false) ⇒ Array
Get a single project - gets the latest build.
-
.project_add(provider:, slug:, options: nil, verbose: false) ⇒ Hash
Add a project.
-
.project_delete(account:, project:, options: nil, verbose: false) ⇒ Int
Delete a project.
-
.project_deployments(account: nil, project: nil, options: nil, verbose: false) ⇒ Array
Get project deployments.
-
.project_history(account: nil, project: nil, limit: 10, start_build: nil, branch: nil, options: nil, verbose: false) ⇒ Array
Get project history.
-
.project_settings(account: nil, project: nil, yaml: false, options: nil, verbose: false) ⇒ Array
Get project settings.
-
.projects(options: nil, verbose: false) ⇒ Array
Fetch projects.
Methods included from Configuration
Class Method Details
.build_artifacts(job_id:, options: nil, verbose: false) ⇒ Array
List artifacts of a job
312 313 314 315 |
# File 'lib/veyor.rb', line 312 def self.build_artifacts(job_id:, options: nil, verbose: false) route = sprintf('/buildjobs/%s/artifacts', job_id) Request.new(route, {}, nil, , verbose).get end |
.build_cancel(account: nil, project:, version:, options: nil, verbose: false) ⇒ Int
Cancel a build
262 263 264 265 |
# File 'lib/veyor.rb', line 262 def self.build_cancel(account: nil, project:, version:, options: nil, verbose: false) route = sprintf('/builds/%s/%s/%s', get_account(account), project, version) Request.new(route, {}, nil, , verbose).delete end |
.build_delete(build_id:, options: nil, verbose: false) ⇒ Int
Delete a build
280 281 282 283 |
# File 'lib/veyor.rb', line 280 def self.build_delete(build_id:, options: nil, verbose: false) route = sprintf('/builds/%s', build_id) Request.new(route, {}, nil, , verbose).delete end |
.build_log(job_id:, options: nil, verbose: false) ⇒ Array
Download a build log
296 297 298 299 |
# File 'lib/veyor.rb', line 296 def self.build_log(job_id:, options: nil, verbose: false) route = sprintf('/buildjobs/%s/log', job_id) Request.new(route, {}, nil, , verbose).get end |
.build_start(account: nil, project:, branch: 'master', options: nil, verbose: false) ⇒ Array
Start build of branch of most recent commit
242 243 244 245 246 |
# File 'lib/veyor.rb', line 242 def self.build_start(account: nil, project:, branch: 'master', options: nil, verbose: false) body = { :accountName => get_account(account), :projectSlug => project, :branch => branch } Request.new('builds', {}, body, , verbose).post end |
.environment_settings(id:, options: nil, verbose: false) ⇒ Array
Get environment settings
342 343 344 345 |
# File 'lib/veyor.rb', line 342 def self.environment_settings(id:, options: nil, verbose: false) route = sprintf('/environments/%s/settings', id) Request.new(route, {}, nil, , verbose).get end |
.environments(options: nil, verbose: false) ⇒ Array
environments
Get environments
328 329 330 |
# File 'lib/veyor.rb', line 328 def self.environments(options: nil, verbose: false) Request.new('environments', {}, nil, , verbose).get end |
.project(account: nil, project: nil, branch: nil, version: nil, options: nil, verbose: false) ⇒ Array
Get a single project - gets the latest build
112 113 114 115 116 117 |
# File 'lib/veyor.rb', line 112 def self.project(account: nil, project: nil, branch: nil, version: nil, options: nil, verbose: false) route = prep_route('projects', get_account(account), project, branch, version) Request.new(route, {}, nil, , verbose).get end |
.project_add(provider:, slug:, options: nil, verbose: false) ⇒ Hash
Add a project
132 133 134 135 136 137 |
# File 'lib/veyor.rb', line 132 def self.project_add(provider:, slug:, options: nil, verbose: false) route = prep_route('projects', nil, nil, nil, nil) body = { :repositoryProvider => check_provider(provider), :repositoryName => slug } Request.new(route, {}, body, , verbose).post end |
.project_delete(account:, project:, options: nil, verbose: false) ⇒ Int
Delete a project
150 151 152 153 |
# File 'lib/veyor.rb', line 150 def self.project_delete(account:, project:, options: nil, verbose: false) route = prep_route('projects', account, project, nil, nil) Request.new(route, {}, nil, , verbose).delete end |
.project_deployments(account: nil, project: nil, options: nil, verbose: false) ⇒ Array
Get project deployments
199 200 201 202 |
# File 'lib/veyor.rb', line 199 def self.project_deployments(account: nil, project: nil, options: nil, verbose: false) route = sprintf('/projects/%s/%s/deployments', get_account(account), project) Request.new(route, {}, nil, , verbose).get end |
.project_history(account: nil, project: nil, limit: 10, start_build: nil, branch: nil, options: nil, verbose: false) ⇒ Array
Get project history
178 179 180 181 182 183 184 |
# File 'lib/veyor.rb', line 178 def self.project_history(account: nil, project: nil, limit: 10, start_build: nil, branch: nil, options: nil, verbose: false) route = sprintf('/projects/%s/%s/history', get_account(account), project) args = prep_args(limit, start_build, branch) Request.new(route, args, nil, , verbose).get end |
.project_settings(account: nil, project: nil, yaml: false, options: nil, verbose: false) ⇒ Array
Get project settings
221 222 223 224 225 226 227 |
# File 'lib/veyor.rb', line 221 def self.project_settings(account: nil, project: nil, yaml: false, options: nil, verbose: false) route = sprintf('/projects/%s/%s/settings', get_account(account), project) if yaml route = route + '/yaml' end Request.new(route, {}, nil, , verbose).get end |
.projects(options: nil, verbose: false) ⇒ Array
Fetch projects
84 85 86 87 |
# File 'lib/veyor.rb', line 84 def self.projects(options: nil, verbose: false) route = prep_route('projects', nil, nil, nil, nil) Request.new(route, {}, nil, , verbose).get end |