Integrating Checkly in your CI/CD pipeline
Core to Checkly’s monitoring as code approach is running your checks from your CI/CD pipeline and use them as E2E tests.
With this approach, you can validate your application and infrastructure before deploying to production, staging or any other environments. Simultaneously , you can life cycle (create/update/delete) your checks from your code base as part of your CI/CD workflow.
CI/CD Integration 101
Regardless of the provider or platform you use, integrating Checkly into your CI/CD pipeline boils down to four basic steps:
- Store your checks as code and
git push
. Preferably store your checks alongside your application code. Just like unit tests. - Wait for your application to be deployed. This can be done through hooks, lifecycle events or wait scripts.
- Run your checks using
npx checkly test
and pass in any variables like anENVIRONMENT_URL
. - If the checks pass successfully, run
npx checkly deploy
.
CI/CD Integration with the Checkly CLI
The preferred and most flexible way to integrate Checkly with your CI/CD platform is through the Checkly CLI.
GitHub Actions
Run the Checkly CLI from GitHub Actions, export summary reports and integrate with mono repos
GitLab CI
Run the Checkly CLI from GitLab CI pipelines, using separate e2e-test and deploy jobs.
Jenkins
Run the Checkly CLI from a Jenkins pipeline using a Jenkinsfile.
CI/CD Integration using vendor webhooks
Last updated on November 13, 2024. You can contribute to this documentation by editing this page on Github