CI/CD with CircleCI
kalix orb to use CircleCI with your Kalix project. The orb supports commands for installing, authenticating, and invoking the Kalix CLI.
To use the
kalix orb, you’ll need to:
Enable CircleCI for your source code repository containing the source code you want to deploy
Enable and activate pipelines in the CircleCI project (Project Settings → Advanced Settings)
Create a service token for your project
Get the name or preferably UUID of your project, which can be obtained by running
kalix projects list
kalix orb expects the authentication token and project ID as parameters. CircleCI context allows you to store the authentication token and project ID values securely using a context.
In your CircleCI account, create a context and:
Store the authentication token as
Store the project ID as
With the authentication variables saved, you can use them in your project configuration.
Follow these steps to create a workflow to invoke the
kalix orb for your project:
Create a folder named
.circleciat the root of the project folder.
Create a file named
config.ymlfor editing and add the CircleCI version:
Reference the orb:
orbs: kalix: firstname.lastname@example.org
Add a job that creates an image and invokes orb commands. For example, to deploy a service named
jobs: run-kalix: docker: - image: 'cimg/base:stable' steps: - checkout - kalix/install (1) - kalix/exec: (2) cmd: services deploy my-service cimg/base:stable
kalix/installcommand installs the Kalix CLI for your CircleCI job and configures it using the
KALIX_PROJECTenvironment variables set in the CircleCI context.
kalix/execcommand executes any command from the Kalix CLI. Do not precede commands with
Add a workflow to schedule the job and give it access to the context storing the authentication variables. For example, with a refresh token and project ID stored in
workflows: version: 1 install-and-run-kalix: jobs: - run-kalix context: - kalix-context
By default, CircleCI jobs are triggered by any push to the repository. See the documentation for scheduling a workflow.