Deplo

Deployments

Deployment history, redeploying, cancelling, rolling back, the deploy hook, and the live counter.

A deployment is one build-and-release of an app. redeploy starts one from the current source; the deploy hook is the same action behind a REST URL a webhook sender can call.

A rollback re-runs the image an earlier build already produced, no rebuild. Only the code goes back: variables, domains, volumes and limits stay current. Ask for Deployment.canRollback first.

Reading

deployments

Any signed-in principal. Returns [Deployment!].

Deployment history in the active team, newest first. Filter to one app, one environment or one status.

ArgumentTypeDescription
appIdString
environmentDeploymentEnvironmentOne of preview, production.
statusDeploymentStatusOne of building, canceled, error, queued, ready.
query {
  deployments(appId: "prj_9f1c2ab7d3e4f5a6", status: ready) {
    id
    status
    commitSha
    commitMessage
    createdAt
    canRollback
  }
}

deployment

Any signed-in principal. Returns Deployment.

One deployment by id, or null. logs carries the build output.

ArgumentTypeDescription
idString!
query {
  deployment(id: "dpl_9f1c2ab7d3e4f5a6") {
    id
    status
    createdAt
    commitMessage
    url
  }
}

Deploying and cancelling

redeploy

Needs deploy_apps. Returns Deployment.

Build and release the app again from its current source and settings. Returns the queued deployment.

ArgumentTypeDescription
appIdString!
mutation {
  redeploy(appId: "prj_9f1c2ab7d3e4f5a6") {
    id
    status
    createdAt
    commitMessage
    url
  }
}

cancelDeployment

Needs deploy_apps. Returns Boolean.

Stop a queued or building deployment. Returns true.

ArgumentTypeDescription
idString!
mutation {
  cancelDeployment(id: "dpl_9f1c2ab7d3e4f5a6")
}

cancelAllDeployments

Needs deploy_apps. Returns Int.

Cancel every in-progress deployment (queued/building) for one app (appId given) or across the whole active team (appId omitted), optionally narrowed to the deployments view filters: one owning server (serverId), one environment, and/or one status. Terminal deployments are left. Returns how many builds were stopped.

ArgumentTypeDescription
appIdID
environmentString
serverIdID
statusString
mutation {
  cancelAllDeployments(appId: "prj_9f1c2ab7d3e4f5a6")
}

Rolling back

rollbackDeployment

Needs rollback_apps. Returns Deployment.

Put an app back on a previous deployment by re-running the image that build left on the server - no clone, no rebuild, no pull. Only a successful production deployment of an app Deplo builds (a repository or an uploaded archive), still inside the app's rollback retention and on the app's current server, can be rolled back to; ask for canRollback on the deployment to know. The code goes back and NOTHING ELSE does: the stack is rendered from the app's current variables, domains, volumes and resource limits. Returns the new deployment.

ArgumentTypeDescription
deploymentIdString!
mutation {
  rollbackDeployment(deploymentId: "dpl_9f1c2ab7d3e4f5a6") {
    id
    status
    createdAt
    commitMessage
    url
  }
}

Pruning history

deleteDeployments

Needs delete_apps. Returns Int.

Delete finished deployments (ready/error/canceled) by id; in-progress ones (queued/building) are left to be canceled first. Returns how many were deleted.

ArgumentTypeDescription
ids[ID!]!
mutation {
  deleteDeployments(ids: ["ids"])
}

deleteAllDeployments

Needs delete_apps. Returns Int.

Delete every finished deployment for one app (appId given) or across the whole active team (appId omitted), optionally narrowed to the deployments view filters: one owning server (serverId), one environment, and/or one status. In-progress deployments are left. Returns how many were deleted.

ArgumentTypeDescription
appIdID
environmentString
serverIdID
statusString
mutation {
  deleteAllDeployments(appId: "prj_9f1c2ab7d3e4f5a6", status: "error")
}

Deploy hook

The hook URL carries its own token. Calling it still needs an API token with deploy_apps; see REST endpoints for the request.

revealAppDeployHook

Needs configure_apps. Returns String.

The app's full deploy hook URL, minting it on first read. Calling it still requires an API token as Authorization: Bearer deplo_....

ArgumentTypeDescription
idString!
mutation {
  revealAppDeployHook(id: "prj_9f1c2ab7d3e4f5a6")
}

rotateAppDeployHook

Needs configure_apps. Returns String.

Mint a new deploy hook URL for the app and return it. Every copy of the previous URL stops working immediately.

ArgumentTypeDescription
idString!
mutation {
  rotateAppDeployHook(id: "prj_9f1c2ab7d3e4f5a6")
}

setAppDeployHookEnabled

Needs configure_apps. Returns App.

Turn this app's deploy hook on or off. Off => the endpoint refuses every call, whatever URL or API token it carries.

ArgumentTypeDescription
idString!
valueBoolean!
mutation {
  setAppDeployHookEnabled(id: "prj_9f1c2ab7d3e4f5a6", value: true) {
    id
    slug
    name
    status
    productionUrl
  }
}

Subscription

activeDeployments

Any signed-in principal. Returns Int.

Emits how many deployments are in flight (queued or building) across the active team, counting only the apps the caller can reach. Fires once immediately, then on every change - it is what the sidebar's live chip reads.

subscription {
  activeDeployments
}

See also

Did this page help you?

On this page