Created
April 16, 2021 01:20
-
-
Save ryan-blunden/2eb3c72bd58fdc1e17ee5dafe2a98981 to your computer and use it in GitHub Desktop.
Crate a Doppler Service Token from the Command Line
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 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