Skip to main content

deployments

Creates, updates, deletes, gets or lists a deployments resource.

Overview

Namedeployments
TypeResource
Iddigitalocean.apps.deployments

Fields

The following fields are returned by SELECT queries:

A JSON of the requested deployment

NameDatatypeDescription
idstring (title: The ID of the deployment, example: b6bdf840-2854-4f87-a36c-5f231c617c84)
causestring (title: What caused this deployment to be created, example: commit 9a4df0b pushed to github/digitalocean/sample-golang)
cloned_fromstring (title: The ID of a previous deployment that this deployment was cloned from, example: 3aa4d20e-5527-4c00-b496-601fbd22520a)
created_atstring (date-time) (title: The creation time of the deployment, example: 2020-07-28T18:00:00Z)
functionsarray (title: Functions components that are part of this deployment)
jobsarray (title: Job components that are part of this deployment)
phasestring (default: UNKNOWN, example: ACTIVE)
phase_last_updated_atstring (date-time) (title: When the deployment phase was last updated, example: 0001-01-01T00:00:00Z)
progressobject
servicesarray (title: Service components that are part of this deployment)
specobjectThe desired configuration of an application. (title: AppSpec)
static_sitesarray (title: Static Site components that are part of this deployment)
tier_slugstring (title: The current pricing tier slug of the deployment, example: basic)
updated_atstring (date-time) (title: When the deployment was last updated, example: 2020-07-28T18:00:00Z)
workersarray (title: Worker components that are part of this deployment)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
apps_get_deploymentselectapp_id, deployment_idRetrieve information about an app deployment.
apps_list_deploymentsselectapp_idpage, per_page, deployment_typesList all deployments of an app.
apps_create_deploymentinsertapp_idCreating an app deployment will pull the latest changes from your repository and schedule a new deployment for your app.
apps_cancel_deploymentexecapp_id, deployment_idImmediately cancel an in-progress deployment.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
app_idstringThe app ID (example: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf)
deployment_idstringThe deployment ID (example: 3aa4d20e-5527-4c00-b496-601fbd22520a)
deployment_typesarrayOptional. Filter deployments by deployment_type - MANUAL: manual deployment - DEPLOY_ON_PUSH: deployment triggered by a push to the app's repository - MAINTENANCE: deployment for maintenance purposes - MANUAL_ROLLBACK: manual revert to a previous deployment - AUTO_ROLLBACK: automatic revert to a previous deployment - UPDATE_DATABASE_TRUSTED_SOURCES: update database trusted sources - AUTOSCALED: deployment that has been autoscaled (example: [MANUAL, AUTOSCALED])
pageintegerWhich 'page' of paginated results to return. (example: 1)
per_pageintegerNumber of items returned per page (example: 2)

SELECT examples

Retrieve information about an app deployment.

SELECT
id,
cause,
cloned_from,
created_at,
functions,
jobs,
phase,
phase_last_updated_at,
progress,
services,
spec,
static_sites,
tier_slug,
updated_at,
workers
FROM digitalocean.apps.deployments
WHERE app_id = '{{ app_id }}' -- required
AND deployment_id = '{{ deployment_id }}' -- required;

INSERT examples

Creating an app deployment will pull the latest changes from your repository and schedule a new deployment for your app.

INSERT INTO digitalocean.apps.deployments (
data__force_build,
app_id
)
SELECT
{{ force_build }},
'{{ app_id }}'
RETURNING
deployment
;

Lifecycle Methods

Immediately cancel an in-progress deployment.

EXEC digitalocean.apps.deployments.apps_cancel_deployment 
@app_id='{{ app_id }}' --required,
@deployment_id='{{ deployment_id }}' --required;