LinuxCommandLibrary

doctl-apps

Manage DigitalOcean application deployments

TLDR

Create an app

$ doctl [[a|apps]] [[c|create]]
copy

Create a deployment for a specific app
$ doctl [[a|apps]] [[cd|create-deployment]] [app_id]
copy

Delete an app interactively
$ doctl [[a|apps]] [[d|delete]] [app_id]
copy

Get an app
$ doctl [[a|apps]] [[g|get]]
copy

List all apps
$ doctl [[a|apps]] [[ls|list]]
copy

List all deployments from a specific app
$ doctl [[a|apps]] [[lsd|list-deployments]] [app_id]
copy

Get logs from a specific app
$ doctl [[a|apps]] [[l|logs]] [app_id]
copy

Update a specific app with a given app spec
$ doctl [[a|apps]] [[u|update]] [app_id] --spec [path/to/spec.yml]
copy

SYNOPSIS

doctl apps [command] [options]

Common commands and their general syntax:
doctl apps list
doctl apps get
doctl apps create --spec
doctl apps deploy
doctl apps update --spec
doctl apps delete
doctl apps logs

PARAMETERS

list
    Lists all applications associated with your DigitalOcean account.

get
    Retrieves detailed information about a specific application using its ID.

create
    Creates a new application. This command typically requires an application specification file (YAML/JSON) or interactive input.

deploy
    Initiates a new deployment for an existing application.

update
    Updates an existing application's specification. Requires an application ID and usually a new specification file.

delete
    Deletes an application. This action is irreversible and removes all associated resources.

logs
    Streams or fetches logs for a specified application or its components.

spec
    Manages application specifications. Subcommands include get (to retrieve a spec), validate (to check a spec's syntax), and generate (to create a basic spec).

proposals
    Manages app proposals, which allow you to preview app changes before applying them.

rollback
    Rolls back an application to a previous successful deployment.

cancel-deployment
    Cancels a running deployment for an application.

DESCRIPTION

The doctl apps command is the primary interface for managing DigitalOcean App Platform applications directly from the command line.
It allows users to perform a wide range of operations on their applications, including listing existing applications, retrieving detailed information about a specific application, creating new applications from source code repositories or OCI images, deploying new versions of applications, monitoring deployments, and managing application components (services, workers, jobs, static sites, databases).

This command streamlines the CI/CD workflow by enabling automation of app deployments and configuration changes, making it an essential tool for developers and DevOps engineers working with DigitalOcean.

CAVEATS

  • Requires a properly configured doctl CLI with a valid DigitalOcean API token.
  • Deleting an application with doctl apps delete is irreversible and will remove all associated resources and data.
  • Advanced operations like create and update heavily rely on a correct understanding and construction of App Platform specification files (YAML/JSON).

APPLICATION SPECIFICATION (APP SPEC)

Many powerful operations with doctl apps, especially create and update, are driven by an Application Specification file (typically app.yaml or app.json). This declarative configuration defines your entire application, including its components (services, workers, static sites, jobs, databases), environment variables, build commands, and more. Proficiency with the App Spec is crucial for advanced usage and automation.

DEPLOYMENT LIFECYCLE MANAGEMENT

The doctl apps command suite provides extensive control over the application deployment lifecycle. Commands like deploy initiate new builds and deployments, logs helps in monitoring and debugging, and rollback offers a quick way to revert to a previous stable state. This makes doctl apps a cornerstone for integrating DigitalOcean App Platform into CI/CD pipelines.

HISTORY

The DigitalOcean App Platform was officially launched in October 2020. The doctl apps command and its comprehensive set of subcommands were introduced concurrently to provide command-line management capabilities for this new service. Since its inception, the command has been continuously updated to reflect new features and functionalities added to the App Platform, becoming an indispensable tool for automating and managing application deployments on DigitalOcean.

SEE ALSO

doctl(1), doctl auth(1), doctl account(1), git(1)

Copied to clipboard