Integrate with CI/CD tools

Akka Serverless development projects can be integrated into a Continuous Integration/Continuous Delivery (CI/CD) process using the Akka Serverless CLI. To use the Akka Serverless CLI in your CI/CD workflow, you’ll need an authentication token. This token can be configured using your own Akka Serverless 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 an Akka Serverless authentication token to set up any CI/CD process. To create the token, run the command below:

akkasls 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 akkasls in a CI/CD process

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

  • Install the Akka Serverless 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 AKKASLS_TOKEN for the authentication token and AKKASLS_PROJECT for the project ID, the snippet below configures the Akka Serverless CLI to run in your CI/CD environment.

# Download and install the Akka Serverless CLI
curl -sL https://developer.lightbend.com/docs/akka-serverless/get.sh | bash

# Set the authentication token
akkasls config set refresh-token $AKKASLS_TOKEN

# Set the project you want to work with
akkasls config set project $AKKASLS_PROJECT