Module: Octokit::Client::Deployments
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/deployments.rb
Overview
Methods for the Deployments API
Constant Summary collapse
- DEPLOYMENTS_PREVIEW_MEDIA_TYPE =
"application/vnd.github.cannonball-preview+json".freeze
Instance Method Summary collapse
-
#create_deployment(repo, ref, options = {}) ⇒ Sawyer::Resource
Create a deployment for a ref.
-
#create_deployment_status(deployment_url, state, options = {}) ⇒ Sawyer::Resource
Create a deployment status for a Deployment.
-
#deployment_statuses(deployment_url, options = {}) ⇒ Array<Sawyer::Resource>
(also: #list_deployment_statuses)
List all statuses for a Deployment.
-
#deployments(repo, options = {}) ⇒ Array<Sawyer::Resource>
(also: #list_deployments)
List all deployments for a repository.
Instance Method Details
#create_deployment(repo, ref, options = {}) ⇒ Sawyer::Resource
Create a deployment for a ref
32 33 34 35 36 |
# File 'lib/octokit/client/deployments.rb', line 32 def create_deployment(repo, ref, = {}) = ensure_deployments_api_media_type() [:ref] = ref post("#{Repository.path repo}/deployments", ) end |
#create_deployment_status(deployment_url, state, options = {}) ⇒ Sawyer::Resource
Create a deployment status for a Deployment
56 57 58 59 60 61 |
# File 'lib/octokit/client/deployments.rb', line 56 def create_deployment_status(deployment_url, state, = {}) = ensure_deployments_api_media_type() deployment = get(deployment_url, :accept => [:accept]) [:state] = state.to_s.downcase post(deployment.rels[:statuses].href, ) end |
#deployment_statuses(deployment_url, options = {}) ⇒ Array<Sawyer::Resource> Also known as: list_deployment_statuses
List all statuses for a Deployment
43 44 45 46 47 |
# File 'lib/octokit/client/deployments.rb', line 43 def deployment_statuses(deployment_url, = {}) = ensure_deployments_api_media_type() deployment = get(deployment_url, :accept => [:accept]) get(deployment.rels[:statuses].href, ) end |
#deployments(repo, options = {}) ⇒ Array<Sawyer::Resource> Also known as: list_deployments
List all deployments for a repository
16 17 18 19 |
# File 'lib/octokit/client/deployments.rb', line 16 def deployments(repo, = {}) = ensure_deployments_api_media_type() get("#{Repository.path repo}/deployments", ) end |