Creating a Deployment

Updated 1 week ago by Copado Solutions

Copado allows you to create a deployment from different places when moving changes across different environments in your pipeline:

  • From the Deployments tab.
  • From a User Story record.
  • From a Promotion record.

Creating a Deployment from the Deployments Tab

When you create a deployment from the Deployments tab, you have three different options:

  1. The Metadata Deployment option allows you to execute a standalone deployment following the deployment wizard.
  2. The Data Deployment option allows you to easily deploy a data template you have already configured following the wizard.
  3. If you choose the Advanced (multi-step) deployment, you will be redirected to the classic deployment page, where you can set up different deployment steps:

To create a deployment using this option follow the steps below:

  1. Give your deployment a name.
  2. Select a source org and a destination org.
Prior to creating the deployment, you should have created the source org credentials and the destination org credentials. Estimations are cached for a few minutes for performance reasons, therefore, they might not reflect the latest changes. Estimations may not be 100% accurate.
When deploying from Git, you don't need to choose a source org unless you need to combine other steps that are not Git metadata.
  1. Add the required steps.
  2. Save your deployment
  3. When you manually create the deployment, Copado doesn’t automatically start the deployment. Click on Deploy and then on Deploy All or Deploy Outstanding to start the deployment process:

Creating a Deployment from a User Story

When you commit changes on a user story, you can then create a deployment by flagging the Promote & Deploy checkbox. Copado will trigger the creation of a Promotion and a Deployment record and will execute the deployment:

If you want to make sure your commits are deployable and ensure a successful deployment, you can click on Validate Changes to perform a validation deployment. If the validation is successful, you can then go ahead and execute the deployment:

Creating a Deployment from a Promotion

If you want to deploy a group of user stories, you can create a promotion and select the user stories you want to deploy. Only the user stories that have been flagged as Ready to Promote will be available for selection.

To create a deployment from a promotion, follow the steps below:

  1. Navigate to the Selected User Stories section in the Promotion record.
  2. Select the user stories you want to deploy from the list of available user stories.
  3. Click on Create Deployment:

  1. A pop-up window will appear next. Here you can choose the test level you want to apply to your deployment.

    If you just want to create a validation deployment, flag the Validation Only checkbox. Copado will create a promotion branch in your repository, however, the deployment step will be set as Check Only. As a result, no changes will be merged towards the destination branch, and it will not lead to any updates in the environment of the user stories:

  1. Then, click on Submit.

When you submit the deployment, the following actions are triggered:

  1. A new promotion branch is created out of the destination branch with the name promotion/{}. Once created, Copado merges every feature branch for each of the user stories promoted.  
  2. Copado creates a single Git Promotion step in the deployment.
  3. If you have specified any manual steps in the user story, these will be added to the deployment.
When you create a validation-only deployment, user story deployment tasks as well as full profile and full permission set steps are not created. If you want to deploy these tasks in a real deployment, you cannot reuse the validation deployment and will need to launch a new deployment.
Shallow fetch depth in Git can be configured by adding @gitDepth=XXX to the name of the Deployment record created from the promotion, where XXX is the depth of the history of commits that are used, e.g. @gitDepth=200@gitDepth=500@gitDepth=1000.
@gitDepth is case sensitive.

Once the deployment is completed successfully, the following will happen:

  1. The promotion branch will be automatically merged into the destination branch, which is the branch related to the destination org in the pipeline. If the name of the deployment contains :tag=x.y.z, Copado will create and push a Tag x.y.z. Tags cannot be duplicated, therefore, the tag is typically added when deploying to production and merging into master.
  2. The user stories in the promotion to which the deployment is linked will be moved to the next environment in the pipeline.
  3. The checkboxes Ready to Promote and Promote and Deploy will be unchecked.
If the user stories in your promotion include components that were added using a commit (Add Commits), the deployment step created will be a Git Metadata step that will contain the entire file where the components are included. This deployment will not merge feature branches, and Copado will not deploy incremental changes but the entire file.

Troubleshooting a Deployment

To further review your deployment results and troubleshoot any potential issues when working with Git Promotion, Git MetaData and MetaData deployment steps, you can add @debug to the deployment name, and Copado will generate a downloadable file following the naming convention Deploy-{deploymentJobId}.zip and will attach it to the Deployment record once the deployment is completed:

Please note that, while getting this file can be very helpful, it can also use a lot of your storage. To avoid running out of storage, follow the steps provided in the article Copado Branches Cleanup. This will delete validation or previously failed deployment records that you specify. Alternatively, you can delete the attachment from the deployment record once it has served your purpose.

How did we do?