module Octokit::Client::Deployments
Direct including types
Defined in:
octokit/client/deployments.crInstance Method Summary
-
#create_deployment(repo : String, ref : String, task : String = "deploy", auto_merge : Bool = true, required_contexts : Array(String) | Nil = nil, payload : Hash(String, String) = {} of String => String, environment : String = "production", description : String = "", transient_environment : Bool = false, production_environment : Bool = true, **options) : Deployment
Create a deployment for a ref The ref parameter can be any named branch, tag, or SHA
-
#create_deployment_status(repo : String, deployment_id : Int64, state : String, target_url : String = "", log_url : String = "", description : String = "", environment : String | Nil = nil, environment_url : String = "", auto_inactive : Bool = true, **options) : DeploymentStatus
Create a deployment status for a Deployment
-
#delete_deployment(repo : String, deployment_id : Int64, **options) : Bool
Delete a Deployment
-
#deployment(repo : String, deployment_id : Int64, **options) : Deployment
Fetch a single deployment for a repository
-
#deployment_status(repo : String, deployment_id : Int64, status_id : Int64, **options) : DeploymentStatus
Get a deployment status
-
#deployment_statuses(repo : String, deployment_id : Int64, **options) : Paginator(DeploymentStatus)
List all statuses for a Deployment
-
#deployments(repo : String, params : Hash(String, String) = {} of String => String, **options) : Paginator(Deployment)
List deployments for a repository
-
#list_deployment_statuses(repo : String, deployment_id : Int64, **options) : Paginator(DeploymentStatus)
alias for
#deployment_statuses
-
#list_deployments(repo : String, params : Hash(String, String) = {} of String => String, **options) : Paginator(Deployment)
Alias for
#deployments
Instance Method Detail
Create a deployment for a ref The ref parameter can be any named branch, tag, or SHA
See Also:
Examples: Create a deployment for a ref
Octokit.create_deployment("monalisa/app", "main")
Octokit.create_deployment("monalisa/app", "main", description: "Deploying main branch!")
Create a deployment status for a Deployment
:param repo [String]: The repository to create a deployment status for in org/repo format (required) :param deployment_id [Integer]: The deployment id (required) :param state: can be one of the following: error, failure, inactive, in_progress, queued, pending, success :param options [String]: :target_url The target URL to associate with this status. Default: "" :param options [String]: :description A short description of the status. Maximum length of 140 characters. Default: "" :return: A deployment status
See Also:
Examples:
Octokit.create_deployment_status("monalisa/app", 1234567890, "success")
Delete a Deployment
If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment.
To set a deployment as inactive, you must:
Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment. Mark the active deployment as inactive by adding any non-successful deployment status.
See Also:
Octokit.delete_deployment("monalisa/app", 123456)
Fetch a single deployment for a repository
See Also:
Examples:
Fetch a single deployment for a repository
deployment = Octokit.deployment("monsalisa/app", 123456)
puts deployment.id
Get a deployment status
See Also:
Examples:
Octokit.deployment_status("monalisa/app", 1234567890, 1234567890)
List all statuses for a Deployment
See Also:
Examples:
Octokit.deployment_statuses("monalisa/app", 1234567890)
You should use a paginated octokit instance to fetch all statuses:
client = Octokit.client
client.auto_paginate = true
client.per_page = 100
data = client.deployment_statuses("monalisa/app", 1234567890)
puts data.records.to_pretty_json
Returns an array of deployment statuses
List deployments for a repository
See Also:
Examples: List deployments for a repository
Octokit.deployments("monalisa/app")
Filter deployments by environment:
Octokit.deployments("monalisa/app", {"environment" => "production"})
An alias method exists for #deployments
called #list_deployments
which can be used interchangeably
alias for #deployment_statuses
Alias for #deployments