Configuring the Ant Migration Tool with Jenkins
To communicate with Salesforce, we need to install the Ant Migration Tool on the Jenkins server. We have already covered the installation steps for the Ant Migration Tool in Chapter 4, Introduction to the Force.com Migration Tool. Install the Ant Migration Tool on the Jenkins server and configure the path in Jenkins. Once you install the Ant plugin in Jenkins, you will get the option to Invoke Ant
in the Add build step
dropdown menu for your Jenkins Job, which will run build.xml
and perform the tasks mentioned in the script:
When the developer triggers the Jenkins Job, we will select Invoke Ant
to retrieve the Salesforce metadata. Once the build is successful, we will have the metadata in the directory and trigger the Jenkins job to push the metadata from Jenkins to the GitLab repository. Verify the metadata in the GitLab repository.
Now we will set the global credentials in Jenkins.
Go to Manage Jenkins
and select Global Tool Configuration
. On...