Skip to content

Instantly share code, notes, and snippets.

@ryan-blunden
Created April 16, 2021 01:20
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ryan-blunden/2eb3c72bd58fdc1e17ee5dafe2a98981 to your computer and use it in GitHub Desktop.
Save ryan-blunden/2eb3c72bd58fdc1e17ee5dafe2a98981 to your computer and use it in GitHub Desktop.
Crate a Doppler Service Token from the Command Line
#!/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