App Platform is a Platform-as-a-Service (PaaS) offering that allows developers to publish code directly to DigitalOcean servers without worrying about the underlying infrastructure.
You can view a deployment’s logs to check for error messages and rollback deployments as needed.
To retrieve logs for a specific deployment using the CLI or API, you need to provide deployment’s ID. You can retrieve a list of deployments and their IDs using the CLI’s doctl apps list-deployments
command or the /v2/apps/{app_id}/deployments
endpoint
To review your app deployments in the control panel, click on your app and then click on the Activity tab to view your app’s history of deployment activity. Click the Deployment link for any active deployment to view its real-time logs.
The deployment marked as “LIVE” is the one currently being served at the live URL for your app. You can click the commit link to go to the commit that triggered a deployment or hover over the -m
flag to see the commit message.
To manually redeploy your app, click the Action button in the top right corner, then click Deploy in the drop-down menu. This pulls the latest code from the resource’s associated source repo and runs a build and deploy process.
You can undo a faulty deployment by rolling back the app to a previous deployment. This lets you recover from accidentally deploying code with errors or an app spec that causes failures. You can roll back to the ten most recent successful deployments.
To roll back an app to a previous deployment, the deployment must be in the same region as the app and must have the same database resources and configuration.
Rolling back an app restores the app’s code, configuration, and app spec, but not any database data. To roll back a database’s data, restore it from a backup as described in the Managed Databases documentation.
To rollback a deployment using the API, you need to provide app’s ID and the ID of the deployment you want rollback to. Use the /v2/apps
to retrieve a list of apps and their respective IDs, and use the /v2/apps/{app_id}/deployments
endpoint to retrieve a list of deployments for a specified app.
To roll back an app, go to the Apps page and click your app, then click the Activity tab.
In the Activity tab, click the Rollback link for the deployment you want to roll back. The Rollback window that opens displays a comparison between the current deployment and the selected deployment:
Expand the app resource name under Global Settings Changed to see whether the source code or resource settings have changed. For source code changes, you can use the commit link to go to the commit that triggered the deployment you want to roll back to. You can also hover over the -m
flag to see the commit message.
Expand ALL SETTINGS DIFF to see the diff between your current and previous deployment’s app spec. Any additions and deletions to the spec are displayed using + and -.
Click Rollback to start the rollback deployment. The rollback deployment duplicates the old deployment and contains the same code and configurations.