Last active
October 4, 2021 00:26
-
-
Save smmr0/cce0afa40881e695c699d67e01cc957f to your computer and use it in GitHub Desktop.
do-app-update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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