How To: Backfill your pipeline
This guide is applicable when
- When you have multiple pipelines in your Datical project
- You have deployed on one pipeline (for example Oct release pipeline) and ready to backfill your deployments in the other pipeline (for example Nov release pipeline)
- You bypassed your deployments to rush something to production and now you need to deploy your changes to lower environments to keep them in sync
Overview
A backfill is really two operations in one:
- First: You add the label to your changesets to indicate that your changes are eligible for deployment in the new pipeline. For example, if you used "oct_release" label to deploy October changes and now you want to backfill these changes to your November pipeline, you would add "nov_release" label to your October changesets
- Second: You perform a deploy operation on November pipeline using the "nov_release" label. This way, all your October changes will be deployed into November pipeline.
We will assume that you have a Datical project setup with two pipelines that look like the diagram below. You used "Pipeline1" to deploy October changes using the label "oct_release". Your October changes are now in UAT. You are now ready to start working on November code and in preparation for deploying November changes into "Pipeline2" you now need to prepare REF2, DEV2 and QA2 databases with October changes.
You will need to have Datical DB's composite repo installed with necessary drivers for your database. For installing drivers for automation (e.g., for use with Jenkins), use "hammer installDrivers" command to install drivers that are necessary to complete these steps.
Step-by-step guide (Using automation via "hammer" CLI)
Using Datical DB's command line tool "hammer", follow these steps to implement backfill operation, i.e., deploy October changes into "Pipeline 2":
- CLI - Add Labels: You will first add November label "nov_release" to all October changes
- use "hammer addLabels" command to add labels to October changes
Here is the help for "hammer addLabels" command
- For our example, use this command to add "nov_release" label to October changes:
hammer addLabels --lookupChangesets="oct_release" --labels="nov_release"
- Successful completion of this command generates the following output:
You have now successfully added "nov_release" label to all October changes.
- use "hammer addLabels" command to add labels to October changes
- CLI - Deploy: Now deploy October changes into Pipeline 2 using "hammer" command
- You can now Forecast on REF2.
- Use "hammer forecast" command. Here is the help for "hammer forecast" command
For our example, use this command to forecast "nov_release" label to October changes:
hammer forecast REF2 --labels="nov_release"
- Successful completion of this command generates the following output:
- Review the forecast report.
- Use "hammer forecast" command. Here is the help for "hammer forecast" command
- Since backfill using CLI is typically performed by an automation tool, it is a good practice to perform "statusDetails" both before and after the deploy operation in order to track pre-deploy and post-deploy status of your database.
- Use "
hammer statusDetails REF2
" command to obtain status of the REF2 database prior to the deploy operation - Here is a sample output of "hammer statusDetails" command:
- Use "
- Use "hammer deploy" command. Here is the help for "hammer forecast" command
For our example, use this command to forecast "nov_release" label to October changes:
hammer deploy REF2 --labels="nov_release"
- Review the deploy report for any errors during deployment
- Perform "hammer statusDetails" again after successful deployment:
- Use "
hammer statusDetails REF2
" command to obtain status of the REF2 database after the deploy operation
- Use "
- You have now successfully backfilled October changes into REF2 database.
- Repeat steps 2a-2d to backfill DEV2 and QA2 databases.
- You can now Forecast on REF2.
Step-by-step guide (Using Datical DB GUI)
Using Datical GUI follow these steps to implement backfill operation, i.e., deploy October changes into "Pipeline 2":
GUI - Add Label: You will first add November label "nov_release" to all October changes
Click on the "Status" button on your REF1.
Click on "Fully Deployed" link (or "Undeploy Changes" depending on your database status)
Your list of changes may look something like this where you have "oct_release" label tied to several change sets:
Use the search box at the top. Type "oct_release" and click Filter by Label button to get a list of only Octobers:
Now click "Select All (on this tab) button at the bottom to select all October changes, and then click Add Labels button:
In the "Ad Hoc Labels to Add" field, type "nov_release".
- Alternately, you may have the nov_release label listed in the "Available" column if you setup your project settings with these labels.
Click Next.
Review your "Labels Before" and "Labels After" screen and click Finish.
You have now successfully added "nov_release" label to all October changes.
GUI - Deploy: Go back to the Plan tab and switch over to the Pipeline 2.
You can now Forecast on REF2. Click the Forecast button (or "Forecast with Options" link) to bring up Forecast Options window.
- Check the box for "Use Labels"
- Specify "nov_release" label
- Click Finish.
If the Forecast report shows no errors, then click on the Deploy button for REF2 (or "Deploy with Options" link) to bring up Deploy Options window.
- Check the box for "Use Labels"
- Specify "nov_release" label and click Finish.
You have now successfully backfilled October changes into REF2 database.
Repeat steps 2a-2b to backfill DEV2 and QA2 databases.
Related articles
Copyright © Datical 2012-2020 - Proprietary and Confidential