Git Repository and Main Release Flow

Updated 6 months ago by Copado Solutions

If you are working with pipelines and are using the pipeline wizard to create your environments and the connections between them, please note that steps 4 and 6 will be automatically performed by the wizard.
  1. Create a new repository in your Git version control provider (e.g. GitHub, Bitbucket, GitLab or other).
  2. Commit the example .gitignore file to the master branch to avoid tracking unnecessary files, thus keeping your branches only with the files you need.
  3. Link Copado to your Git repository:
    1. If your Git repository is behind a firewall, you will need to whitelist the Copado IP addresses. Check out the article Connect a Git Repository Protected by a Firewall (On Premise) for more information.
    2. It is recommended that developers and admins working with Copado have access to the Git repository to review their changes and see who modified specific lines of code or configuration files.
  4. Create a Git snapshot record for the production org with the master branch:
    1. A Git snapshot links an org to a Git branch in your Git repository in order to perform actions such as backups, commit to the branch, or commit metadata changes via a user story.
    2. The org credential of the user story will determine which Git snapshot will be used for the commit.
  5. Follow Salesforce’s Git trailhead for more information on version control.
  6. Click on Take Snapshot Now in the Git Snapshot record that links the production org to the master branch of your Git repository. All the metadata components of the org which are not included in the .gitignore file will be committed to the branch:

Git Snapshot record

  1. Once the snapshot is completed, verify in your Git repository that the metadata components have been committed to the master branch. Then, create new branches out of the master branch that correspond to each of the other orgs (e.g. dev1, int, UAT).
  2. In Copado, create the Git Snapshot records for each of the other orgs with their corresponding branch and org credential. Branch names are case sensitive, therefore, make sure the branch name in Git is exactly the same as that in the snapshot in Copado:
    1. Consider creating a release management user in each org with access to all the metadata. Link each Git Snapshot record to the org credential of the release management user.
    2. Users that will be committing to user stories need access to a Git Snapshot record which is linked to an org credential that is in turn linked to the same environment of the user story. If they do not have access to this Git snapshot, you must share the org credential record with them so that they have access to the Git snapshot.
  3. Create a pipeline. Select the Git Repository record and the main branch to track all metadata changes in Git. The main branch is usually master, from which the user story feature branches will be created.
  4. Create pipeline connections to connect the different orgs in the pipeline. For each step, select the source and destination environments and type in the branch related to the source environment.

How did we do?