Generate a token for CI/CD integration

This is for:

Developer

Qubit CLI supports token-based authentication for use inside of CI/CD environments. This enables use cases such as automated unit testing, pushing, and publishing of experiences from within tools such as CodeShip, Jenkins, or CircleCI.

In this article we will cover how you go about generating a long-lived token. When done, the CLI will use the token for authentication rather than a user login.

In the event that your token is compromised, we will also show you how to revoke it.

Generating a token

Step 1

Run:

qubit token
Warning

Keep this token safe as it gives the CLI access to the Qubit platform.

Step 2

Inside your build system, export the token as an environment variable named QUBIT_TOKEN:

export QUBIT_TOKEN=[token]
  • Where [token] is the token value

The build system can now install packages from the Qubit managed NPM registry, access the platform to push/pull code, or perform any other function such as publishing.

Revoking a token

Run:

qubit revoke [token]
  • Where [token] is the token value

Tip
Leading practice

You can find more details via qubit --help.