How to register a deploy
How does Sleuth know when you have deployed? There are five different ways Sleuth can be notified:
When this option is selected Sleuth will guide you through a CI/CD mapping step where you'll map a build / job / pipeline name to each Sleuth environment. Sleuth will then automatically register a deploy on a successfully completed build / job / pipeline that matches the mapped name.
When using CI/CD build deploy detection there is no need to modify your build scripts or change the way you deploy, Sleuth does all the work and will track your deploys precisely and automatically.
For example, we use CircleCI where we have many jobs, but only two are relevant for deploy registration. These are
deploy-stage, so our mapping between CI/CD and Sleuth environments looks like so:
There are several edge cases where using CI/CD mapping won't be an option:
- The GitHub Actions workflow uses the matrix feature
- The code repository is in Bitbucket and the CI/CD system is on Azure
- The branch mapped to the target environment in Sleuth is a prefixed branch
When build mapping is not an option, the fallback is to register deploys with a webhook.
Ping Sleuth with a Git commit SHA or a tag to tell Sleuth you've deployed by making a
POSTrequest. You'll need to provide theses values when making the call:
You can find your API Key in Organization Settings > Details > Api key:
Locating your Sleuth API key
You can find
YOUR_SHAusing the commands:
git checkout YOUR_BRANCH
git rev-parse HEAD
When this option is selected Sleuth will treat every merged PR on your branch as a deploy.
When this option is selected Sleuth will treat every commit made to your branch as a deploy.
When this option is selected Sleuth will treat every tag made on your branch as a deploy.