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 four different options, each of them represented by a record type:

  1. Metadata Deployment: This option allows you to execute a standalone deployment following the deployment wizard.
  2. Data Deployment: This option allows you to easily deploy a data template you have already configured following the data deployment wizard.
  3. Automation Template: If you choose this option, you will be taken to the automation template configuration screen, where you can add different deployment steps that you can save and execute in the future.
  4. Advanced (multi-step): This option will take you 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.
Before 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. If desired, select the Attach Deployment Files checkbox. See the Troubleshooting a Deployment section below for more information about this checkbox.
  2. Add the required steps.
  3. Save your deployment
  4. 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.
    1. 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 flagged 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.
    2. If desired, select the Attach Deployment File checkbox. See the Troubleshooting a Deployment section below for more information about this checkbox:
    Attach Deployment File Checkbox
  2. 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 on 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.
Please be aware that @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 check the Attach Deployment File checkbox. When you select this checkbox, Copado generates a downloadable file following the naming convention Deploy-{deploymentJobId}.zip that contains the logs with the deployment results and attaches it to the Deployment record once the deployment is completed:

  • You can flag it when creating a deployment from the deployments tab:

  • Or when creating a deployment from a promotion:
Attach Deployment File Checkbox
Please note that the option to enable this checkbox is only available for users with a Copado Admin or Copado User license.
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 file from the deployment record once it has served your purpose.
Since v17.8, @debug will no longer be added to the deployment name when using the Attach Deployment File checkbox, but instead, it will be saved on the new Copado__Attach_Deployment_File__c field. However, if desired, you can still manually add @debug in the deployment name.

How did we do?