Integrate with CI/CD tools

Kalix development projects can be integrated into a Continuous Integration/Continuous Delivery (CI/CD) process using the Kalix CLI. To use the Kalix CLI in your CI/CD workflow, you’ll need an authentication token. This token can be configured using your own Kalix account, or you can create a separate account tied to a different email address by inviting that address to your project.

Create a token

You will need a Kalix authentication token to set up any CI/CD process. To create the token, run the command below:

kalix auth tokens create --type=refresh --scopes=execution --description="My CI/CD token"

The output will look similar to:

Token created: cst1.832640ce01f08072e91e3c848eb0767763f94ba9f973fa127d0c285a74e88076

Copy and paste the token to a safe location. You will not be able to view the token again

Configure kalix in a CI/CD process

The basic steps to configure the Kalix CLI to run in your CI/CD environment are:

  • Install the Kalix CLI

  • Set the authentication token

  • Set the project you want to work with (this must be the UUID of the project)

Using the environment variables KALIX_TOKEN for the authentication token and KALIX_PROJECT for the project ID, the snippet below configures the Kalix CLI to run in your CI/CD environment.

# Download and install the Kalix CLI
curl -sL https://docs.kalix.io/install-cli.sh | bash

# Set the authentication token
kalix config set refresh-token $KALIX_TOKEN

# Set the project you want to work with
kalix config set project $KALIX_PROJECT