Forked from ryan-blunden/create_doppler_service_token.sh
Created
July 24, 2022 11:07
-
-
Save yspreen/ebd0e08db33f2833651c9a39a9ed0d0f to your computer and use it in GitHub Desktop.
Crate a Doppler Service Token from the Command Line
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
#!/usr/bin/env bash | |
# Requires a CLI token | |
DOPPLER_TOKEN="$(doppler configure get token --plain)" \ | |
DOPPLER_PROJECT="$(doppler configure get project --plain)" \ | |
DOPPLER_CONFIG="$(doppler configure get config --plain)" \ | |
\ | |
SERVICE_TOKEN=$(curl -sS --request POST \ | |
--url https://api.doppler.com/v3/configs/config/tokens \ | |
--header 'Content-Type: application/json' \ | |
--header "api-key: $DOPPLER_TOKEN" \ | |
--data "{\"project\":\"$DOPPLER_PROJECT\",\"config\":\"$DOPPLER_CONFIG\",\"name\":\"$DOPPLER_PROJECT VS Code Dev Container\"}" | jq -r '.token.key') | |
echo "DOPPLER_TOKEN=$SERVICE_TOKEN" > .devcontainer/.env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment