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/_deployYou 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:
- Install dependencies.
- Build and test the application.
- Build the Docker image.
- Push the image to the project registry.
- Call
org-application:deploywith the pushed image name and tag.
Migrating from
paas-action? Projects still deploying throughpaas-action@<=1.2.2keep working during the transition via a compatibility bridge, but new pipelines should callorg-application:deploydirectly.