deployments
Creates, updates, deletes, gets or lists a deployments
resource.
Overview
Name | deployments |
Type | Resource |
Id | digitalocean.apps.deployments |
Fields
The following fields are returned by SELECT
queries:
- apps_get_deployment
- apps_list_deployments
A JSON of the requested deployment
Name | Datatype | Description |
---|---|---|
id | string | (title: The ID of the deployment, example: b6bdf840-2854-4f87-a36c-5f231c617c84) |
cause | string | (title: What caused this deployment to be created, example: commit 9a4df0b pushed to github/digitalocean/sample-golang) |
cloned_from | string | (title: The ID of a previous deployment that this deployment was cloned from, example: 3aa4d20e-5527-4c00-b496-601fbd22520a) |
created_at | string (date-time) | (title: The creation time of the deployment, example: 2020-07-28T18:00:00Z) |
functions | array | (title: Functions components that are part of this deployment) |
jobs | array | (title: Job components that are part of this deployment) |
phase | string | (default: UNKNOWN, example: ACTIVE) |
phase_last_updated_at | string (date-time) | (title: When the deployment phase was last updated, example: 0001-01-01T00:00:00Z) |
progress | object | |
services | array | (title: Service components that are part of this deployment) |
spec | object | The desired configuration of an application. (title: AppSpec) |
static_sites | array | (title: Static Site components that are part of this deployment) |
tier_slug | string | (title: The current pricing tier slug of the deployment, example: basic) |
updated_at | string (date-time) | (title: When the deployment was last updated, example: 2020-07-28T18:00:00Z) |
workers | array | (title: Worker components that are part of this deployment) |
A JSON object with a deployments
key. This will be a list of all app deployments
Name | Datatype | Description |
---|---|---|
id | string | (title: The ID of the deployment, example: b6bdf840-2854-4f87-a36c-5f231c617c84) |
cause | string | (title: What caused this deployment to be created, example: commit 9a4df0b pushed to github/digitalocean/sample-golang) |
cloned_from | string | (title: The ID of a previous deployment that this deployment was cloned from, example: 3aa4d20e-5527-4c00-b496-601fbd22520a) |
created_at | string (date-time) | (title: The creation time of the deployment, example: 2020-07-28T18:00:00Z) |
functions | array | (title: Functions components that are part of this deployment) |
jobs | array | (title: Job components that are part of this deployment) |
phase | string | (default: UNKNOWN, example: ACTIVE) |
phase_last_updated_at | string (date-time) | (title: When the deployment phase was last updated, example: 0001-01-01T00:00:00Z) |
progress | object | |
services | array | (title: Service components that are part of this deployment) |
spec | object | The desired configuration of an application. (title: AppSpec) |
static_sites | array | (title: Static Site components that are part of this deployment) |
tier_slug | string | (title: The current pricing tier slug of the deployment, example: basic) |
updated_at | string (date-time) | (title: When the deployment was last updated, example: 2020-07-28T18:00:00Z) |
workers | array | (title: Worker components that are part of this deployment) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
apps_get_deployment | select | app_id , deployment_id | Retrieve information about an app deployment. | |
apps_list_deployments | select | app_id | page , per_page , deployment_types | List all deployments of an app. |
apps_create_deployment | insert | app_id | Creating an app deployment will pull the latest changes from your repository and schedule a new deployment for your app. | |
apps_cancel_deployment | exec | app_id , deployment_id | Immediately 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.
Name | Datatype | Description |
---|---|---|
app_id | string | The app ID (example: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf) |
deployment_id | string | The deployment ID (example: 3aa4d20e-5527-4c00-b496-601fbd22520a) |
deployment_types | array | Optional. 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]) |
page | integer | Which 'page' of paginated results to return. (example: 1) |
per_page | integer | Number of items returned per page (example: 2) |
SELECT
examples
- apps_get_deployment
- apps_list_deployments
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;
List all deployments of an app.
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 page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND deployment_types = '{{ deployment_types }}';
INSERT
examples
- apps_create_deployment
- Manifest
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
;
# Description fields are for documentation purposes
- name: deployments
props:
- name: app_id
value: string
description: Required parameter for the deployments resource.
- name: force_build
value: boolean
Lifecycle Methods
- apps_cancel_deployment
Immediately cancel an in-progress deployment.
EXEC digitalocean.apps.deployments.apps_cancel_deployment
@app_id='{{ app_id }}' --required,
@deployment_id='{{ deployment_id }}' --required;