Skip to content

Instantly share code, notes, and snippets.

@jsierles
Created May 27, 2020 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsierles/a1bbfb10564ece87185853e7b714593f to your computer and use it in GitHub Desktop.
Save jsierles/a1bbfb10564ece87185853e7b714593f to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Fetch DO registry credentials and set them in Convox
doctl_path=$(which doctl)
convox_path=$(which convox)
if [ ! -x "$doctl_path" ] || [ ! -x "$convox_path" ]; then
echo "'doctl' and 'convox' CLIs must be installed to run this script."
fi
echo "Fetching DO registry credentials..."
do_registry_token=$(doctl registry --context chatterbug kubernetes-manifest | yq -r '.data[".dockerconfigjson"]' | base64 -d | jq -r '.auths["registry.digitalocean.com"].auth' | base64 -d | cut -d: -f1)
convox registries add registry.digitalocean.com $do_registry_token $do_registry_token
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment