Skip to content

CI/CD overview

A CI/CD job reaches CloudRepo the way a laptop does: the build tool sends a repository token with each request. What a pipeline adds is the question of where the token lives. The answer is the same on every platform: in the platform’s secret store, handed to the job as an environment variable, and read by a committed config file or a command that names the variable.

Platform Where the secret lives Guide
GitHub Actions Repository Settings, Secrets and variables, Actions Publish from GitHub Actions
GitLab CI/CD Project Settings, CI/CD, Variables Publish from GitLab CI/CD
CircleCI Org, Contexts (or Project Settings, Environment Variables) Publish from CircleCI
Jenkins Manage Jenkins, Credentials, a Secret text credential Publish from Jenkins
Bitbucket Pipelines Repository settings, Pipelines, Repository variables, Secured Publish from Bitbucket Pipelines

Each guide has a tab for Maven, Gradle, npm, Python and Docker. A tab shows what the pipeline needs to read the token: copy it, replace the placeholders (your-org, your-repo, you@example.com) with your own values, and adapt it to your build.

If Dependabot or Renovate keeps your dependencies current, they need the same token to read your repositories. Dependabot and Renovate with CloudRepo shows the registry block for each, for Maven, npm, Python and Docker.

  1. Create the token for the pipeline. Limit the token to the repositories the pipeline needs. Give it Download packages if it only pulls, or Download and publish packages if it publishes. Set an expiry and replace the token before that date. Rotating a token gives you a new value but keeps the same expiry, so it does not extend the token’s life. Instead, create a new token with a new expiry, update your platform’s secret, and revoke the old one.
  2. Create it as an account that outlives any one person. A token you create under Repository Tokens belongs to your account. Deleting a user from your organization deletes that user’s tokens, and any pipeline using one stops authenticating. A user you make for builds at an email address of its own, not yours (see Create Your First User), signed in to the admin portal when it mints the token, keeps your builds working when a teammate leaves. The owner can instead create an organization token, which belongs to your organization rather than to a user.
  3. Store the token as a secret named CLOUDREPO_TOKEN in your platform.
  4. Name the variable in a committed file; never the token. Maven reads ${env.CLOUDREPO_TOKEN} in settings.xml, npm reads ${CLOUDREPO_TOKEN} in .npmrc, Gradle reads providers.environmentVariable("CLOUDREPO_TOKEN"), twine reads TWINE_PASSWORD, and docker login reads the token from standard input. The guides show each one.
  5. Keep the token off the command line. A process listing shows a command’s arguments to other users of the machine. Every block in the guides passes the token through the environment, a file or standard input.

The username every client sends, where it sends one, is the email address of the account that created the token. An organization token is the exception: its username is the word token. npm sends the token alone. See Repository Tokens for each client’s credential and for what a 401, 403 or 404 means.

A GitOps tool pulls from CloudRepo the way a build does: with a repository token, which it keeps in a Kubernetes Secret and never in a committed manifest. Pull CloudRepo Helm charts from Argo CD and Flux shows the objects for each tool.

The blocks in these guides use only environment variables, files and standard input, so they carry to any CI that can set an environment variable from a secret store. Put the token in that store as CLOUDREPO_TOKEN, and use the client’s block from the guide of the platform closest to yours. If a platform’s guide would save you time, email support@cloudrepo.io.

View as Markdown