amguerrero / sfdc_ant_tasks

Salesforce.com ANT Deployment Helper Tasks
14 stars 5 forks source link

deltaDeploment missing *.cls-meta.xml files #3

Closed TedHusted closed 7 years ago

TedHusted commented 7 years ago

Classes, components, and pages have companion .-meta files.

The companion files for classes is not be written to the deltaDeployment folder, and perhaps the others.

The meta files contain the API version and other fields, which are needed at deploy time.

Could the matching .-meta files be copied into the deltaDeploy folder.

amguerrero commented 7 years ago

Hi Ted,

I haven't test it at this moment, but I think that if the meta.xml files are changed, by changing the API. Or the object is newly created, the deltaDeployment task will add it to the delta folder.

As these -meta.xml files are only needed when there is a change on them, or when the objects to be deployed are new, I think the deltaDeployment is working well enough. But maybe I'm missing something, could you please test on your side if any any of the scenarios: 1) Change in a -meta.xml information or 2) New class, component or page was added since the last deployment?

Think that the delta deployment is meant to deploy the changes on an org based on the previous deployment on that org. At least this is the way I have been using it: Jenkins created a git tag for each successful deployment, and the deployment jenkins task picked up the previous successful deployment to build the package to be deployed and we never had any issue.

If you run into any issue trying to deploy, maybe you run into a scenario of which I didn't think, but if you detail it to me, I can try to adjust the deltaDeployment ant task behavior to work properly in your scenario.

TedHusted commented 7 years ago

I appreciate the quick response, Manuel.

Could you please try this experiment for me? The attached zip has a single empty Apex class. Could you deploy it to an org using the standard SF deploy task -- then remove the meta file and try the deploy a second time?

I've been unable to get this class (and other classes) to deploy a second time without the meta file. Presumably, I'd have the same problem with components and pages.

src.zip

amguerrero commented 7 years ago

Hi Ted,

you are completely right, I guess I never used this ant task when just a class, page or component changed.

I have pushed a fix for this. If you download the latest jar it has it fixed, now it looks for the -meta.xml files and copies them to the delta directory, so they will be deployed as well.

TedHusted commented 7 years ago

Thank you, Manuel. The new jar is working perfectly.

Here is the repository with the Ant build scripts that I mentioned the other day

Next, I'd like to learn more about Groovy and writing Ant tasks, since I think we are doing bits with shell scripts and Python that would work better as real tasks.

-Ted.