Platforms

Envlet on GitLab CI

One masked CI/CD variable, then envlet run in the job script.

Set the token
glab variable set ENVLET_TOKEN --masked --value "$(cat ~/.config/envlet/tokens/ci-staging.token)"
Job script
test:
  script:
    - npx -y @envlet/cli run -- npm test

Set up

  1. 01

    Create a token

    Create an identity for GitLab CI and a token for the environment it deploys.

  2. 02

    Set one secret

    Add ENVLET_TOKEN as a masked, protected CI/CD variable for the environment the pipeline deploys.

  3. 03

    Start through Envlet

    Prefix job commands with envlet run. The CLI reads ENVLET_TOKEN from the job environment.

Questions

Will my app start if Envlet is down?
No, and that is the point. It retries for a few seconds, then fails so you notice, instead of starting with half an environment.
Do I still need GitLab CI's own secret store?
Only for ENVLET_TOKEN. Everything else lives in Envlet, so you rotate in one place.

Stop pasting .env files.

One command. The right values for whoever runs it.