3

I am trying to set up a Jenkins job which uses the migration tool to move code from a source control system to an org. To test the job I created a new custom object named aaaTest__c. I changed my package.xml to the following:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>aaaTest__c</members>
        <name>CustomObject</name>
    </types>
    <version>31.0</version>
</Package>

When my Jenkins job runs I see 1160 components that failed to deploy. These include objects, workflows, triggers, classes and more. The object errors appear to be for the custom fields on that object. The errors all look like this:

workflows/Account.workflow (Account.Test_Task) -- Error: Not in package.xml

I don't understand why the migration tool is trying to deploy all of these components when I'm telling it just deploy one. Any help will be greatly appreciated.

1 Answer 1

3

The migration tool does little more than to zip the directory, then send it through the the metadata API. In other words, it's not exceptionally "smart." You'll probably want to build some scripts to move all files not explicitly mentioned into a temp directory so that the resultant zip file won't include non-included components, or at least build a script that attempts to pull a fresh directory based on your package file, then deploy that new directory. This is the technique I'm using until I finish my new toolkit. It gives me the ability to do this:

ant pkg:account from:dev1 retrieve to:env1 copy deploy

From, to, and pkg targets set script variables, while retrieve, copy, and deploy targets use those variables to do specified actions. Each environment gets its own directory, so copy just recursively copies one folder to the other.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .