IBM Cloud Docs
Promoting and deploying changes

Promoting and deploying changes

The DevSecOps reference implementation helps to enforce the review of code changes before they are merged, promoted, and deployed to production.

Promoting inventory entries from source to target branches

To promote code changes from the source (master) branch to the target (staging, prod) branch of your inventory repository (repo), complete the following steps:

  1. The continuous integration pipelines populate the source (master) branch with inventory entries. Use the continuous deployment promotion pipeline to promote this content from your source (master) branch to the target (staging or prod) branch.

    • From the cd-pipeline dashboard, click Run Pipeline.
    • Select Manual Promotion Trigger.
    • Click Run. The pipeline-run creates a merge request to promote your code changes from the source branch to the target branch.

    Manual Promotion Trigger
    Figure 1. Manual Promotion Trigger

  2. Approve and merge the pull request.

    • Click the pipeline-run and check the execution log of the promotion pipeline.

    MR execution log
    Figure 2. MR execution log

    • Locate the URL of the merge request and open the merge request.
    • Populate the required fields (Priority, Change Request assignee, Additional Description, and other fields).
    • Merge the merge request to promote your changes from the source branch to the target branch.

Now that your changes are promoted to the target branch, you can deploy them by using the continuous deployment pipeline.

Deploying changes from the source-environment to the target-environment

The source and target environments are defined at the continuous deployment pipeline level.

continuous deployment pipeline properties
Figure 3. Continuous deployment pipeline properties

Depending on the continuous deployment pipeline trigger settings, the pipeline is either automatically triggered after a merge request is merged or the pipeline is merged manually. To manually merge the pipeline, click Run Pipeline and choose the trigger to run.

The pipeline starts and tags the current commit in the inventory repo with the Pipeline Run ID. The pipeline uses that tag to pick up the content from the target branch (prod) and calculates the deployment delta between the current commit and the content of the last successful deployment. The delta is identified by the <target-environment>_latest tag, where target-environment is the value that is set in your continuous deployment pipeline properties, such as prod_latest.

The pipeline attempts to deploy the content. During the deployment, the change request ID is attached to the commit that the pipeline works with as a tag. A successful deployment concludes by attaching the <target-environment>_latest tag to the commit that you promoted.

Git Repos and Issue Tracking repo tags
Figure 4. Git Repos and Issue Tracking repo tags

For more information about the inventory workflow, see Understanding DevSecOps pipelines.