Creating a deployment
Creating a code deployment is an easy 3 step process. Sleuth guides you through each step and it only takes about 1 - 2 minutes to configure. Creating a code deployment results in pulling in your last 30 days of deploys (DORA metrics) and leaves you fully setup to track your DORA metrics moving forward.
The 3 steps to create a code deployment are:
- 1.Enable Integrations
- 2.Add Code Deployment
- 3.Choose Tracking Type
Configuring a code deployment in Sleuth is simple. You just map the repository and branch that your team deploys from and away you go.
Sleuth is very flexible and will support the way that your team works. For teams that deploy the same branch to all pre-production and production environments you will just choose that branch on this screen.
However, some teams maintain a branch for each environment they deploy to. If this is how your team works you will click the checkbox that says
Map separate branches to environments
This allows you to tell Sleuth which branch it should inspect for which environment.
Some teams will cut a release branch with a predictable name for each deployment they make. If your team works this way you can type in the prefix of the branch name you create and Sleuth will provide you with an option to track
branches matching prefix.
In this example Sleuth would look for changes on any branch that matches the prefix
It's not uncommon for teams to maintain multiple deployable units of code in one large repository , this style of repository structure is called a Monorepo. Sleuth supports Monorepo's for code deployments.
The way to set up a Monorepo in Sleuth is to add one code deployment for each deployable unit of code within your Monorepo. When configuring the code deployment you will open the
Advancedsettings and use the
Source path prefix (include)and the
Source path prefix (exclude)fields to tell Sleuth which parts of the repository to include or exclude. Once configured Sleuth will only register deploys that had changes made within the patterns defined.
Sleuth supports a number of ways to track your code deploys. The easiest, zero conf, way to start tracking is connecting Sleuth to your CI/CD system and letting Sleuth detect when you've made a deploy.
By default Sleuth will initialize a code deployment with the last 30 days of deploys we can detect. This will allow you to quickly get a baseline of your DORA metrics for the last 30 days. Sleuth uses past events, based on the tracking type you've chosen to seed the initial deploys.
For instance, if you have connected up CircleCI and mapped your deploy jobs to Sleuth we will find all of the successful jobs run in the last 30 days and create deploys for those. Similarly, if you have chosen to manually tell Sleuth about deploys with a webhook we will use the last 30 days worth of pull requests to initialize your deploys.
Initializing more than 30 days worth of data is not a common thing teams require. It's a manual process and will take more effort on your part. If you do need to do so please make sure to follow the directions throughly.
For some teams 30 days of past data won't be enough to meet their needs. If you want to manually import past data into Sleuth it is possible but you must follow these steps, in the right order:
- 1.Create your code deployment
- 2.When selecting the tracking type choose
- 3.On the
Using the webhookconfirmation screen open the
Advancedconfiguration and deselect the option that says
Populate deploys from the last 4 weeks
- 4.Once the deployment has been created you will then need to manually register the past deploy SHA's with Sleuth in one of two ways using the deploy-registrationAPIs
- 1.(Recommended) Import past deploys via a CSV file using the
- 2.Import deploys one by one using the
- 5.Once you're satisfied with how the older data looks inside of your code deployment you can edit the code deployment to have the Tracking type that you'd like moving forward.
If you run into trouble initializing the data you can always delete the deployment, re-create it and try populating again.