CI/CD

TeamCity

Use Ennote secrets in TeamCity: store an Ennote token as a password parameter exposed as an environment variable, and inject secrets into build steps with ennote secret get.

How it works

TeamCity stores one Ennote token as a password parameter. Parameters that start with env. are passed to build steps as environment variables, so the CLI finds ENNOTE_TOKEN automatically. ennote secret get <secret> -- <command> then runs the 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 TeamCity

In the project (or build configuration) settings, open Parameters → Add new parameter and add:

NameKindValue
env.ENNOTE_TOKENEnvironment variable, spec Passwordthe token
env.ENNOTE_ORGANIZATION_IDEnvironment variableyour organization ID
env.ENNOTE_WORKSPACE_IDEnvironment variableyour workspace ID
env.ENNOTE_DO_NOT_TRACKEnvironment variable1

A Password parameter is hidden in the UI and masked in build logs. Parameters set on the project are inherited by all its build configurations.

3. Install the CLI on your agents

TeamCity agents often run without root. Install the CLI once on each agent, or in the agent image, as root:

curl -sSfL https://get.ennote.io/get-cli.sh | sh

4. Add the build steps

Add a Command Line build step with Custom script:

ennote secret get db-credentials -- npm run migrate
ennote secret get aws -- ./deploy.sh

Replace db-credentials and aws with your secret names.

Kotlin DSL

If you keep your settings in Kotlin DSL, the same configuration looks like this. Generate a secure token for the Ennote token in Project Settings → Versioned Settings → Tokens and reference it by its credentialsJSON: ID, so the value is not stored in your repository:

.teamcity/settings.kts
object Deploy : BuildType({
    name = "Deploy"

    params {
        password("env.ENNOTE_TOKEN", "credentialsJSON:<token-id>")
        param("env.ENNOTE_ORGANIZATION_ID", "org_123")
        param("env.ENNOTE_WORKSPACE_ID", "wrk_prod")
        param("env.ENNOTE_DO_NOT_TRACK", "1")
    }

    steps {
        script {
            name = "Deploy"
            scriptContent = "ennote secret get aws -- ./deploy.sh"
        }
    }
})

FAQ

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.