Automating Your App Platform Deployments with doctl
Mason Egger
Developer Advocate
4
Quick Outline
Our App
�
Resources
7
8
doctl
DigitalOcean’s Command Line Tool�(or DigitalOcean Control)
doctl
9
doctl apps -h
Usage:
doctl apps [command]
Aliases:
apps, app, a
Available Commands:
create Create an app
create-deployment Create a deployment
delete Deletes an app
get Get an app
get-deployment Get a deployment
list List all apps
list-deployments List all deployments
logs Get logs
update Update an app
App Platform Spec
App Spec Parts
�
App Spec Reference - https://www.digitalocean.com/docs/app-platform/resources/app-specification-reference/
Top Level
name: sammy-reader
domains:
- domain: sammy.shark.codes
�
static_sites
static_sites:
- name: rss-reader-frontend
github:
repo: do-community/rss-reader-frontend
branch: master
deploy_on_push: true
routes:
- path: "/"
envs:
- key: REACT_APP_API_URL
scope: RUN_AND_BUILD_TIME
value: sammy.shark.codes/api
type: GENERAL
�
databases
databases:
- name: rss
engine: PG
version: '12'
�
services
services:
- name: rss-reader-api
instance_count: 1
instance_size_slug: professional-xs
routes:
- path: "/api"
github:
repo: do-community/rss-reader-api
branch: main
deploy_on_push: true
run_command: gunicorn --worker-tmp-dir /dev/shm rss_reader.wsgi
envs:
�
services
17
- key: DB_USER
scope: RUN_AND_BUILD_TIME
value: "${rss.USERNAME}"
type: GENERAL
- key: DB_PASSWORD
scope: RUN_AND_BUILD_TIME
value: "${rss.PASSWORD}"
type: GENERAL
- key: DB_HOST
scope: RUN_AND_BUILD_TIME
value: "${rss.HOSTNAME}"
type: GENERAL
- key: DB_NAME
scope: RUN_AND_BUILD_TIME
value: "${rss.DATABASE}"
type: GENERAL
- key: DB_PORT
scope: RUN_AND_BUILD_TIME
value: "${rss.PORT}"
type: GENERAL
- key: DEBUG
scope: RUN_AND_BUILD_TIME
value: 'True'
type: GENERAL
- key: DJANGO_ALLOWED_HOSTS
scope: RUN_AND_BUILD_TIME
value: sammy.shark.codes
type: GENERAL
- key: APP_PLAT_ROUTE
scope: RUN_AND_BUILD_TIME
value: api
type: GENERAL
Let’s Get Deploying
Thanks for attending!