MuleSoft Plugin Configuration Steps

Updated 1 week ago by Copado Solutions

To get the MuleSoft plugin for Multi-Cloud up and running in your organization, there are several steps you need to follow. This is what the overall process looks like:

Configuration steps flow

You may already be working with Copado for Salesforce DevOps, in which case you don’t need to follow the process of installing Copado and getting the necessary licenses. If this is not the case, review the article Copado Base Setup and Implementation before proceeding with the plugin installation.

If you don’t have a MuleSoft application, it is recommended that you build it before installing the plugin and creating the records in Copado, as there are some parameters related to your application that you will need to add to Copado. For more information about how to do this, review Mulesoft’s article Build an Application from an API Specification

Installing the Plugin 

First of all, you need to install the MuleSoft plugin (unlocked package). 

The plugin requires the latest version of Copado. If you don’t have the Copado Deployer package installed yet, do so before installing this plugin.

Additionally, make sure My Domain is enabled in the org where you are installing the plugin. Otherwise, you won't be able to complete the installation process.

To do this, follow the steps below:

  1. Contact your customer success manager to get the MuleSoft plugin.
  2. Install the plugin in your Copado org (select the option Install for Admins Only). Once the installation is complete, click on Done.
  3. Next, go to the App Launcher and navigate to the Copado Extensions tab.
  4. Select MuleExtensionBundle in the Select Extension picklist.
  5. Then, click on Generate Extension Records. Copado will create all the promotion and deployment step records in your org.
    1. In the future, when you upgrade the plugin package to the latest version, remember to repeat the Generate Extension Records action to update the plugin scripts.

Once this process is complete, you need to perform some manual steps and create the environment and pipeline records in Copado. Go ahead and see how you can do this.

Copado Configuration

Picklist Value

Add the Mulesoft value to the Platform picklist field in both Environment and Pipeline objects (see Salesforce’s article Add or Edit Picklist Values for more information about how to do this) to ensure these records reference the correct platform:

Platform Picklist values
Git Repository Record

Create the Git Repository record to connect your  MuleSoft Git repository with Copado. You can find the step-by-step process in the Git Repository Overview article.

MuleSoft Git Repository record
Environment Records

Create the different environments that will be part of your pipeline, your local dev environment, staging and production. For more information about how to create an environment, review the article Environments article. 

You can also use the CLI command sfdx copado:environment:create to create the Environment records.
Environment record
Since Copado’s data model is based on credentials, you need a credential for each environment even if you are not working with a traditional Salesforce pipeline. When you create a non-Salesforce environment, Copado automatically creates the corresponding Credential record for you.
Credential record
Environment System Properties

Once you have created all the environments, navigate to the System Properties related list in the Environment record and create the following system properties:

  1. App Name:
    1. Property Name: Mule App Name
    2. API Name: Mule_App_Name
    3. Value: Your app name. E.g., MuleDev.
  2. Environment Name:
    1. Property Name: Mule Environment Name
    2. API Name: Mule_Environment_Name
    3. Value: The name of the environment. E.g., Staging
  3. Skip Test:
    This property allows you to specify whether or not you want to run MUnit tests when deploying (you need an enterprise MuleSoft license to be able to run MUnit tests).
    1. Property Name: Mule Skip Test
    2. API Name: Mule_Skip_Test
    3. Value: true or false 
      If you set it to false, you need to create two additional system properties:
      1. Mule_Enterprise_Username
      2. Mule_Enterprise_Password
  4. Worker Count (worker count refers to the number of workers, aka servers, that are going to be used in parallel to handle API calls):
    1. Property Name: Mule Worker Count
    2. API Name: Mule_Worker_Count
    3. Value: Your worker count. E.g., 1.
  5. Worker Type (this is the Mulesoft worker size):
    1. Property Name: Mule Worker Type
    2. API Name: Mule_Worker_Type
    3. Value: The worker type. E.g., Micro
Pipeline Record

The next step is to create the Pipeline record. To do that, follow these steps:

  1. Navigate to the Pipelines tab and click on New.
  2. Give your pipeline a name and select the Git Repository record you created in a previous step.
  3. Select the main branch, which is usually master (or main if you use GitHub as Git provider) and flag the Active checkbox.
  4. In the Platform picklist field, select Mulesoft
  5. Based on the platform selected in the previous step, Copado applies one promotion template or another (in this case, the Mule Promote template). If you want to use a different template, you can clone the out-of-the-box template to add additional parameters and select it in the Promotion Automation field.
  6. As with the promotion template, Copado automatically selects the relevant deployment template according to the chosen platform, the Mule Deploy template in this case. If you want to clone this template to include additional parameters, you can then select the cloned template in the Deployment Automation field.
  7. You can leave all other fields for now. Click on Save to save the changes.
Pipeline System Properties

Once you have created the pipeline, navigate to the System Properties related list and create the following system properties:

  1. Client Id:
    1. Property Name: Mule Client Id
    2. API Name: Mule_Client_Id
    3. Value: Your client Id (see MuleSoft’s article Obtaining the Client Credentials of a Registered Client Application for more information about how to obtain your client Id).
    4. Select the Hide Value checkbox (this is not compulsory but is recommended).
  2. Client Secret:
    1. Property Name: Mule Client Secret
    2. API Name: Mule_Client_Secret
    3. Value: Your client secret (see the article above for more information about where to find your client secret).
    4. Select the Is Sensitive checkbox (this is not compulsory but is recommended).
  3. Runtime:
    1. Property Name: Mule_Runtime_Version
    2. API Name: Mule_Runtime_Version 
    3. Value: 4.3.0
Pipeline Connections

Navigate to the Pipeline Connections related list and create the connections between the different environments. Review the section Creating a Pipeline Connection from the Pipeline Connections Related List to go through the step-by-step process.

Project Record

Finally, create a Project record and link your MuleSoft pipeline to it. Review the Project Overview and Setup article for more information about how to do this.

MuleSoft Project record

MuleSoft Updates

Now that you have completed the Copado setup, the last step you need to perform is add the below build xml to the pom.xml file of your MuleSoft project in the root folder:

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-maven-plugin</artifactId>
<version>${mule.maven.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<cloudHubDeployment>
<uri>https://anypoint.mulesoft.com</uri>
<muleVersion>${runtime_version}</muleVersion>
<connectedAppClientId>${clientid}</connectedAppClientId>
<connectedAppClientSecret>${clientsecret}</connectedAppClientSecret>
<connectedAppGrantType>client_credentials</connectedAppGrantType>
<applicationName>${appname}</applicationName>
<environment>${environment}</environment>
<workers>${workerCount}</workers>
<workerType>${workerType}</workerType>
<objectStoreV2>true</objectStoreV2>
</cloudHubDeployment>
</configuration>
</plugin>
</plugins>
</build>

Alright, you have configured the MuleSoft plugin. Now, review the Commit & Deployment Processes in Multi-Cloud article to see how you can commit and deploy your MuleSoft application and changes.


How did we do?