Jenkins
How it works
Jenkins stores one Ennote token as a credential. The Jenkinsfile binds it to ENNOTE_TOKEN, and ennote secret get <secret> -- <command> runs each command with the keys of the secret as environment variables. 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 Jenkins
Open Manage Jenkins → Credentials, choose a store and domain (for example System → Global credentials), and click Add Credentials:
- Kind: Secret text
- Secret: the token
- ID:
ennote-token
3. Install the CLI on your agents
Jenkins agents usually run as the jenkins user without root, so the install script cannot write to /usr/local/bin. Install the CLI once on each agent, or in the image your agents run, as root:
curl -sSfL https://get.ennote.io/get-cli.sh | sh
You can also install the .deb, .rpm or .apk package from the releases page, for example with your configuration management tool.
4. Add the Jenkinsfile
pipeline {
agent any
environment {
ENNOTE_TOKEN = credentials('ennote-token')
ENNOTE_ORGANIZATION_ID = 'org_123'
ENNOTE_WORKSPACE_ID = 'wrk_prod'
ENNOTE_DO_NOT_TRACK = '1'
}
stages {
stage('Migrate') {
steps {
sh 'ennote secret get db-credentials -- npm run migrate'
}
}
stage('Deploy') {
when { branch 'main' }
steps {
sh 'ennote secret get aws -- ./deploy.sh'
}
}
}
}
Replace org_123, wrk_prod, db-credentials and aws with your organization ID, workspace ID and secret names. credentials() makes the token available only during the build and masks it in the console log. when { branch 'main' } works in Multibranch Pipeline jobs; in a regular Pipeline job, remove it.
Docker Agents
If your stages run in a Docker agent, install the CLI in the image you build for CI:
FROM node:22
RUN curl -sSfL https://get.ennote.io/get-cli.sh | sh
pipeline {
agent { docker { image 'my-registry/ci-node:22' } }
// environment and stages as above
}
FAQ
Can I scope the token to one job?
Yes. Store the credential in a folder's credentials store instead of the global one, so only jobs in that folder can use it.
Do I need ennote auth login on the agent?
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.
GitLab CI/CD
Use Ennote secrets in GitLab CI/CD: store an Ennote token as a masked CI/CD variable, install the Ennote CLI in the job, and inject secrets into scripts with ennote secret get.
Azure DevOps
Use Ennote secrets in Azure DevOps Pipelines: store an Ennote token as a secret pipeline variable or in a variable group, map it into the step's environment, and inject secrets with ennote secret get.