---
title: "Ennote Secrets in CI/CD Pipelines"
description: "How to use Ennote secrets in any CI/CD system: store one Ennote token in the CI tool, install the Ennote CLI in the job, and inject secrets into build, test and deploy commands with ennote secret get."
canonical_url: "https://docs.ennote.io/guides/ci-cd/overview"
---
# Ennote Secrets in CI/CD Pipelines

> How to use Ennote secrets in any CI/CD system: store one Ennote token in the CI tool, install the Ennote CLI in the job, and inject secrets into build, test and deploy commands with ennote secret get.

Every CI/CD system works with Ennote the same way. Instead of copying each password and API key into your CI tool's settings, you store **one Ennote token** there. The job installs the Ennote CLI, which uses the token to fetch secrets and pass them to your command as environment variables:

```bash
ennote secret get "db-credentials" -- npm run migrate
```

Ennote never writes the values to a file or prints them to the build log. When you rotate a secret in Ennote, the next pipeline run uses the new value, with no change in the CI tool.

## Guides

<table>
<thead>
  <tr>
    <th>
      CI/CD system
    </th>
    
    <th>
      Guide
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      GitHub Actions
    </td>
    
    <td>
      <a href="https://docs.ennote.io/guides/ci-cd/github-actions">
        GitHub Actions
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      GitLab CI/CD
    </td>
    
    <td>
      <a href="https://docs.ennote.io/guides/ci-cd/gitlab-ci">
        GitLab CI/CD
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Jenkins
    </td>
    
    <td>
      <a href="https://docs.ennote.io/guides/ci-cd/jenkins">
        Jenkins
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Azure DevOps Pipelines
    </td>
    
    <td>
      <a href="https://docs.ennote.io/guides/ci-cd/azure-devops">
        Azure DevOps
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Bitbucket Pipelines
    </td>
    
    <td>
      <a href="https://docs.ennote.io/guides/ci-cd/bitbucket">
        Bitbucket Pipelines
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      CircleCI
    </td>
    
    <td>
      <a href="https://docs.ennote.io/guides/ci-cd/circleci">
        CircleCI
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      TeamCity
    </td>
    
    <td>
      <a href="https://docs.ennote.io/guides/ci-cd/teamcity">
        TeamCity
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      AWS CodeBuild and CodePipeline
    </td>
    
    <td>
      <a href="https://docs.ennote.io/guides/ci-cd/aws-codebuild">
        AWS CodeBuild
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      Google Cloud Build
    </td>
    
    <td>
      <a href="https://docs.ennote.io/guides/ci-cd/google-cloud-build">
        Google Cloud Build
      </a>
    </td>
  </tr>
</tbody>
</table>

Not on the list? The steps below work in any system that can run a shell command.

## The Three Steps

<steps level="3">

### Create a token

Create a [Personal Access Token](https://docs.ennote.io/docs/auth/user-tokens) with an expiration date and copy it. The pipeline can read every secret the token's owner can read, so use an account with access only to the workspaces the pipeline needs.

### Store the token in your CI tool

Save it as a secret or masked variable named `ENNOTE_TOKEN`. This is the only credential your CI tool holds.

### Install the CLI and run your command

Set these environment variables in the job, then install the CLI and run your command through it:

<table>
<thead>
  <tr>
    <th>
      Variable
    </th>
    
    <th>
      Value
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ENNOTE_TOKEN
      </code>
    </td>
    
    <td>
      The token, from your CI tool's secret store
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        ENNOTE_ORGANIZATION_ID
      </code>
    </td>
    
    <td>
      Your organization ID
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        ENNOTE_WORKSPACE_ID
      </code>
    </td>
    
    <td>
      The workspace that holds this pipeline's secrets
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        ENNOTE_DO_NOT_TRACK
      </code>
    </td>
    
    <td>
      <code>
        1
      </code>
      
      , to turn off telemetry and update checks
    </td>
  </tr>
</tbody>
</table>

```bash
curl -sSfL https://get.ennote.io/get-cli.sh | sh
ennote secret get "app" -- ./deploy.sh
```

With `ENNOTE_TOKEN` set, the CLI does not need `ennote auth login` ([ennote auth](https://docs.ennote.io/cli/commands/auth)).

</steps>

## Installing the CLI

The install script downloads the latest release from GitHub, checks its SHA-256 checksum and puts the `ennote` binary in `/usr/local/bin`. It needs:

- Linux or macOS. Windows agents are not supported by the script; use a Linux agent, or install the CLI on Windows with [Scoop](https://docs.ennote.io/cli/overview#windows-scoop).
- `curl`, `tar`, `awk` and `sha256sum` (or `shasum`). Most CI images have them; on Alpine run `apk add --no-cache curl` first.
- Write access to `/usr/local/bin`: run as root, or as a user with passwordless `sudo`. Hosted runners on GitHub, Azure DevOps and CircleCI allow this.

On self-hosted agents without root, such as many Jenkins and TeamCity agents, install the CLI once on the agent or bake it into your build image. Download the binary or the `.deb`, `.rpm` or `.apk` package from the [releases page](https://github.com/ennote-io/ennote-cli/releases/latest). A preinstalled CLI also makes jobs faster and pins the version you run.

## Separate Environments

Keep each environment's secrets in its own [workspace](https://docs.ennote.io/docs/workspaces/overview), for example `staging` and `production`, and set `ENNOTE_WORKSPACE_ID` per job or per CI environment. For the strongest separation, use a different token for production, owned by an account that only has access to the production workspace.

To read one secret from another workspace in a single command, pass `--workspace-id` ([override flags](https://docs.ennote.io/cli/commands/secret/get#override-flags)).

## Keeping Values Out of Logs

- **Prefer process injection.** `ennote secret get "<secret>" -- <command>` passes values to the command without printing them.
- **Avoid printing single values.** `ennote secret get "<secret>:<key>"` writes the value to stdout. If you must use it, capture it in a variable instead of echoing it, because CI log masking only knows about the CI tool's own secrets, not values fetched from Ennote.
- **Don't enable shell tracing** (`set -x`) in steps that handle secrets.

## Rotating the Token

Create a new token, update `ENNOTE_TOKEN` in your CI tool, run a pipeline to check it, then revoke the old token in Ennote ([Personal Access Tokens](https://docs.ennote.io/docs/auth/user-tokens)). Set a reminder before the token's expiration date.

<need-help>



</need-help>


## Sitemap

See the full [sitemap](https://docs.ennote.io/sitemap.md) for all pages.
