Skip to content

Instantly share code, notes, and snippets.

@smmr0
Last active October 4, 2021 00:26
Show Gist options
  • Save smmr0/cce0afa40881e695c699d67e01cc957f to your computer and use it in GitHub Desktop.
Save smmr0/cce0afa40881e695c699d67e01cc957f to your computer and use it in GitHub Desktop.
do-app-update
#!/usr/bin/env sh
set -e
app_name="$1"
app_id="$(doctl apps list --format 'Spec.Name,ID' | tail -n +2 | awk -v "app_name=$app_name" '$1 = $app_name { print $2 }')"
tempfile="$(mktemp --tmpdir "do-$app_name-XXXXXXXXXX.yaml")"
trap 'rm -f "$tempfile"' EXIT
doctl apps spec get "$app_id" > "$tempfile"
"$EDITOR" "$tempfile"
doctl apps update "$app_id" --spec - < "$tempfile"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment