Created
May 27, 2020 17:07
-
-
Save jsierles/a1bbfb10564ece87185853e7b714593f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/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