Create a CI process

Updated 7 months ago by Iván Minaya

Create a CI process

To create a Continuous Integration you will need:

  1. a validated org credential for the org that you are currently in
  2. a validated org credential for the org that you want to deploy to
  3. a validated Git repository within Copado

To create a Continuous Integration:

  1. Click on the tab, “Continuous Integration”. If you can’t find this tab, customize your tabs and make sure that is part of your selection of tabs for the “Copado” application.
  2. Press New and name the CI flow e.g. “My First CI”.
  3. Choose a source Git Repository. If you haven’t created one yet, please create one first. To create a Git repository you only need the HTTP URL of the git file and valid username and password.
  4. Choose a target Salesforce org.
  5. Choose which files to be deployed
    1. All files: every time the CI is executed all files in the repository will be deployed/validated into the target org.
    2. Only committed files: only files modified/created within the Git push, including one or more commits, will be deployed to the target org.
  6. Check Only: when selected, Copado will only perform a Validation and no changes will be made on the target org.
  7. Run all test: when selected, all apex test will be executed on the target org.
  8. Active: if selected the CI is executable, when deactivated any request for execution will be rejected.
  9. Choose pre and post deployment jobs. Pre and post deployment jobs are Copado deployment records. You are able to define a deployment that will run before and after the CI deployment. This pre/post deployment can be use for different actions, like running apex tests, running selenium tests, running source code scan, make git backup of your code, etc. Please take a look to this article to learn more.
  10. Web hooks: Copado can receive web hooks from major Git vendors, including GitHub, Bitbucket, Gitlab, Stash, or any other vendor which is compatible with the previously mentioned. If Copado does not support your Git server, let us know and we can find away to make it work. Each CI will have its own web hook URL. Copado will use an API key to identify the Copado user. Each user has his/her own API key, so deployments performed with that API key will be created under the user’s name. The API key can be renewed at any time from the “Account Summary” tab. Use the “Show Hook URL” button to copy the URL for a particular CI record and for the current user. Make sure that you have created and authenticated your Copado user as in the 1st step of this guide, as your API key will be linked to your Copado user exclusively. In order to setup and automate the creating and running of deployments when a push is received by your Git repository, you will need to do the following:
    1. Go to your Git repository setup page, find the hooks or web hooks section.
    2. Bitbucket: choose the “POST” option, paste the Copado web hook URL.
    3. GitHub: paste the Copado web hook URL under payload URL, choose type as “application/json” and “Just push event” option.
    4. GitLab and Stash are also supported. Similar configuration steps are required to create a webhook as mentioned above.
  11. Running a CI manually: If you are not using web hooks, when pressing the “Run Continuous Integration” button, Copado will create a Build Task and process the latest commit. This option is only recommended in combination with the “Deploy all files” option, so that Copado checkouts the repo and deploys the latest status of your Git repository.
  12. Reviewing a deployment: you can quickly access the Deployment status from the Build task record, or you can navigate to the deployment by clicking on its name for further details. The deployment can be re-run at any time, you can add more steps, clone it, etc. All deployments are named with a prefix “CI:” to help you differentiate these from other deployments.

How did we do?