Salesforce offers a SaaS (Software as a Service) model where its customers can use its applications, and these can be customized using class and package files. DeployHub offers the ability to create these files and store them into various Repositories such as Git and deploy them into Salesforce for a company's Salesforce based applications.


Salesforce offers different regions such as testing, preproduction, etc., where the class and package files can be deployed prior to deploying to production.

Instructions for installation

In order to create the necessary Action for deploying class and package files to Salesforce, you will need to import the Salesforce Procedures into DeployHub.   To import and configure your Salesforce deployment, follow these instructions:



  • Click on the DeployHub Salesforce Deploy Action


  • It would be a good idea to read through the instructions before beginning.


  • At the bottom of the page, there are 6 files. Download all of these except SalesForceDeployAction.png to a folder locally.

Install into DeployHub

Go into DeployHub, click on the Flows menu, click on the Functions and Procedures tab, then click on a Domain and select "Import a Function or Procedure into this Domain". Click the “Choose File” button to navigate to the directory where the 5 files are located, 4 of which have an extension of .re. Select the RunAnt.re file and click the Open button, then click the Import button. Do the same for the GitCheckout.re, SalesForceDeploy.re, and SalesforceCredential.re files. Move the git-checkout file to the $HOME/scripts directory on the location where DeployHub is installed.

NOTE: Double clicking SalesForceDeployAction.png will open it and show the arrangement of the GitCheckout, SalesForceDeploy, and SalesforceCredential Procedures within the SalesForceDeploy Action, described later.


Notice there are now four new Procedures in the Domain named “RunAnt” and “GitCheckout,” which are under the Deploy Category, and “SalesForceDeploy” and “SalesforceCredential,” which are under the SalesForce Category.


The SalesforceCredential Procedure is of the type "DMScript Procedure in Database". It contains DMScript code that takes the username and password of the Credential that is named as it's single argument, and uses its username and password to access a Salesforce region (test, prod, etc.)


The GitCheckout Procedure is of the type "Procedure provided by local external script or program". It has the following arguments:


  • GitRepo: The URL to the Git repository.
  • GitCommit: The version/commit to check out.
  • ToDirectory: Where files will be checked out to, a directory on the same server where DeployHub is installed.


The RunAnt Procedure is of the type "Procedure provided by local external script or program". It has the following arguments:

  • BuildFile: The Ant XML Build, which is a configuration file containing Ant tasks that are to be executed.
  • Target: Which target in the build file will be used when Ant is run. It references a group of tasks i.e., build, test, install, etc.


The SalesforceDeploy Procedure is of the type "DMScript Procedure in Database". It contains DMScript that deploys classes and packages into Salesforce regions (test, production, etc.). It has the following arguments:

  • User: Taken from the SalesForceCredential Procedure.
  • Password: Taken from the SalesForceCredential Procedure.
  • ServerUrl: The Salesforce region to be deployed to.
  • Repo: The Repository where the class and packages exist, typically a filesystem type Repository.
  • TestLevel: When test cases are run, which level (All, Some, etc.)

Create Salesforce Deployment Action

Create the Action to be used to deploy to Salesforce by right clicking on the Actions tab in the same Domain as the Procedures and selecting "New Action in this Domain". In the Workflow tab, scroll down the Activities list on the right side and click on the plus sign next to the Salesforce Category to open it. Click and drag the Procedure that was just created named “GitCheckout” onto the Workspace. Do the same with the Procedures named “SalesforceCredential” and “SalesForceDeploy,” in that order.


The following Global variables must be used as Attributes within any Components that are used for the purpose of deploying files to Salesforce regions:


  • ${GIT_URL} = git url for the repo.  Used in the clone step  executed by the procedure
  • ${GIT_COMMIT} = the commit hash for the version to be checked out from the repo
  • ${GIT_DIR} = temporary directory used to clone and checkout into.  This should be a known name so the Repository for the Component can find the files.


The following Global variables must be used as attributes within any Environments that are used for the purpose of deploying files to Salesforce regions:

  • ${SalesforceCredential} = name of the credential that contains the Salesforce Userid and Password
  • ${ServerURL} = Salesforce URL for the target deployment
  • ${SalesforceRepo} = local repository name pointing to the location in which the git step placed the files in
  • ${TestLevel} = Salesforce Test Case Level


The Action that has been created can now be placed into the Custom Action field of a Component that is used as part of an Application that is deployed to a Salesforce region.