Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yspreen/ebd0e08db33f2833651c9a39a9ed0d0f to your computer and use it in GitHub Desktop.
Save yspreen/ebd0e08db33f2833651c9a39a9ed0d0f 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