Core
PaaS v2.x
2

Continuous deployment #

A CI/CD pipeline can deploy a new application version to Kuzzle PaaS by pushing a Docker image and calling the application deployment API.

Requirements #

  • A Kuzzle PaaS organization, project and environment.
  • A Docker image available in the project container registry.
  • A Kuzzle API token allowed to deploy applications in the target project. A scoped API key issued to a machine identity is the recommended credential for automated pipelines.
  • Access to private packages if your build installs licensed Kuzzle packages. See Access private packages.

Deployment call #

Use the org-application:deploy action:

await kuzzle.query({
  controller: 'org-application',
  action: 'deploy',
  organizationId: 'paas-org-my-company',
  projectId: 'my-project',
  environmentId: 'production',
  applicationId: 'api',
  body: {
    image: {
      name: 'harbor.paas.kuzzle.io/my-company-my-project/api',
      tag: '1.2.3'
    }
  }
});

Equivalent HTTP route:

POST /organizations/:organizationId/projects/:projectId/environments/:environmentId/applications/:applicationId/_deploy

You can discover the deployable image versions of an application with org-application:listArtifacts — see Applications API.

GitHub Actions #

The Kuzzle application template contains an example workflow:

template-kiotp-project deploy workflow

Other CI/CD systems follow the same flow:

  1. Install dependencies.
  2. Build and test the application.
  3. Build the Docker image.
  4. Push the image to the project registry.
  5. Call org-application:deploy with the pushed image name and tag.

Migrating from paas-action? Projects still deploying through paas-action@<=1.2.2 keep working during the transition via a compatibility bridge, but new pipelines should call org-application:deploy directly.

Community #