module Octokit::Client::Deployments

Direct including types

Defined in:

octokit/client/deployments.cr

Instance Method Summary

Instance Method Detail

def 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) #

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!")

[View source]
def 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) #

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")

[View source]
def delete_deployment(repo : String, deployment_id : Int64, **options) #

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)

[View source]
def deployment(repo : String, deployment_id : Int64, **options) #

Fetch a single deployment for a repository

See Also:

Examples:

Fetch a single deployment for a repository

Octokit.deployment("monsalisa/app", 123456)

[View source]
def deployment_status(repo : String, deployment_id : Int64, status_id : Int64, **options) #

Get a deployment status

See Also:

Examples:

Octokit.deployment_status("monalisa/app", 1234567890, 1234567890)

[View source]
def deployment_statuses(repo : String, deployment_id : Int64, **options) : Paginator(Octokit::Models::DeploymentStatus) #

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


[View source]
def deployments(repo : String, params : Hash(String, String) = {} of String => String, **options) #

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


[View source]
def list_deployment_statuses(repo : String, deployment_id : Int64, **options) : Paginator(Octokit::Models::DeploymentStatus) #

[View source]
def list_deployments(repo : String, params : Hash(String, String) = {} of String => String, **options) #

Alias for #deployments


[View source]