GitLab CI/CD
How it works
The job installs the Ennote CLI, which reads ENNOTE_TOKEN, ENNOTE_ORGANIZATION_ID and ENNOTE_WORKSPACE_ID from the environment. ennote secret get <secret> -- <command> runs the command with each key of the secret as an environment variable, without writing a file. See the CI/CD overview for the common setup.
1. Create a token
Create a Personal Access Token with an expiration, and copy it.
2. Store it in GitLab
In your project, open Settings → CI/CD → Variables → Add variable, set the key to ENNOTE_TOKEN, paste the token, and select Mask variable (and Protect variable if only protected branches deploy).
3. Add the job
deploy:
stage: deploy
image: alpine:3.20
variables:
ENNOTE_ORGANIZATION_ID: org_123
ENNOTE_WORKSPACE_ID: wrk_prod
ENNOTE_DO_NOT_TRACK: "1"
before_script:
- apk add --no-cache curl
- curl -sSfL https://get.ennote.io/get-cli.sh | sh
script:
- ennote secret get aws -- ./deploy.sh
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
ENNOTE_TOKEN comes from the CI/CD variable. Replace the IDs and the secret name with yours. On images other than Alpine, install curl with that image's package manager.
FAQ
Can different environments use different workspaces?
Yes. Set ENNOTE_WORKSPACE_ID per job or per GitLab environment, or pass --workspace-id to a single command (ennote secret get).
Do I need ennote auth login?
No. With ENNOTE_TOKEN set, the CLI authenticates headlessly (ennote auth).
Need Help?
If you encounter any issues or have questions, don't hesitate to contact support. Our team is here to assist you with any challenges you might face.
GitHub Actions
Use Ennote secrets in GitHub Actions: install the Ennote CLI on the runner, authenticate with a token stored as a GitHub secret, and inject secrets into a step with ennote secret get, without writing a .env file.
Jenkins
Use Ennote secrets in Jenkins pipelines: store an Ennote token as a Secret text credential, bind it with credentials() in a Jenkinsfile, and inject secrets into build and deploy steps with ennote secret get.