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 testSet up
- 01
Create a token
Create an identity for GitLab CI and a token for the environment it deploys.
- 02
Set one secret
Add ENVLET_TOKEN as a masked, protected CI/CD variable for the environment the pipeline deploys.
- 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.