kevinohara80 / grunt-ant-sfdc Goto Github PK
View Code? Open in Web Editor NEWAdd salesforce and force.com ANT tasks to your grunt builds
License: MIT License
Add salesforce and force.com ANT tasks to your grunt builds
License: MIT License
In ant_sfdc.js
, line 254 points ant to localTmp
for the package.xml
.
However, when using an ad-hoc pkg (using the pkg
property in grunt config, instead of existingPackage
) - the ad-hoc package.xml
doesn't get built to localTmp
, instead getting built to to options.root
- see line 262.
Will put in a PR to fix shortly - likely going to build . I see the existing package code path moves package.xml to the localTmp - so only need to modify the ad-hoc pkg code path - copying the new package.xml in root into localTmppackage.xml
to localTmp
in both lines 262 and 265 (so in both existing package and ad-hoc package situations), just need to check that the retrieved stuff includes a package.xml. If it doesn't, will probably make it write to root
instead, and change line 254 to point ant to that instead
It looks like #46 broke the antdestroy
task which will now need a default value for the zipFile
option.
Work around is for the user to set this option themselves.
antdeploy: {
options: {
root: 'deploy/',
apiVersion: '29.0',
user: 'gunish.chawla@COMPANYNAME',
pass: 'PASSWORD',
token: ''
},
dev: {
option: {
user: 'gunish.chawla@COMPANYNAME', // This variable is no longer read
pass: 'PASSWORD', // This variable is no longer read
token: '' // This variable is not longer read
},
pkg: {
staticresources: ['*']
}
}
},
This tool is wonderful but is unusable behind a (corporate) firewall. This is easy to fix since ant has a setproxy task.
I get this error when attempting to deploy an installed package:
Fatal error: installedPackages is not a valid metadata type
config:
'antdeploy': {
options: {
apiVersion: '36.0'
},
installedPackages: {
options: {
root: 'deploy/',
user: ***********,
pass: ***********,
token: ***********
},
pkg: {
installedPackages: ['*']
}
}
Here's the full console output:
c:\work\salesforce_ant\OptimizeDev>grunt antdeploy:installedPackages --buildtarget=sbsand
Running "antdeploy:installedPackages" (antdeploy) task
Deploy Target -> installedPackages
User -> *************
**Fatal error: installedPackages is not a valid metadata type**
package.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>skuid</members>
<name>InstalledPackage</name>
</types>
<version>36.0</version>
</Package>
skuid.installedPackage:
<?xml version="1.0" encoding="UTF-8"?>
<InstalledPackage xmlns="http://soap.sforce.com/2006/04/metadata">
<versionNumber>8.6</versionNumber>
</InstalledPackage>
Nothing wrong with zipstream. Just like the fact that grunt-contrib-compress is an officially supported plugin and is widely used.
Hi . I am relatively new to grunt . I am currently working with auto deployment system . I have dynamically generated package configuration and want to pass it to grunt-ant-sfdc. but when i use something like
grunt.task.run("antdeploy", {pkg: conf});
i got error
Fatal error: Object # has no method 'replace'
TypeError: Object # has no method 'replace'
at Task.splitArgs (/home/ydadmin/work/yd/ydSalesforce/repo/master/yd-sf-deploy/node_modules/grunt/lib/util/task.js:120:15)
at Task._taskPlusArgs (/home/ydadmin/work/yd/ydSalesforce/repo/master/yd-sf-deploy/node_modules/grunt/lib/util/task.js:135:22)
at Array.map (native)
at Task.run (/home/ydadmin/work/yd/ydSalesforce/repo/master/yd-sf-deploy/node_modules/grunt/lib/util/task.js:170:44)
at /home/ydadmin/work/yd/ydSalesforce/repo/master/yd-sf-deploy/Gruntfile.js:79:28
at ChildProcess.exithandler (child_process.js:635:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket. (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
It would be handy to be able to use existing packages for antdestroy.
It would be nice if there was an option in the deploy settings for resource bundles as well. It wouldn't be too difficult to then zip the files within the folder and deploy them as staticresources
This error pops up periodically when running antdeploy
Running "antdeploy:all" (antdeploy) task
>> Cannot delete nonexistent file.
Deploy Target -> all
User -> [email protected]
Starting ANT deploy...
>> deploy target all successful
When try to execute grunt antdeploy , im getting the following error.
Erkans-MacBook-Pro-2:angular2 erkancipil$ grunt antdeploy
Running "antdeploy:my_pre_dev" (antdeploy) task
Deploy Target -> my_pre_dev
User -> [email protected]
Starting ANT deploy...
Fatal error: Object Buildfile: /Users/erkancipil/Documents/angular2/node_modules/grunt-ant-sfdc/tmp/ant/build.xml
has no method 'replace'
Here is my grunt.js
Main problem is that the calls to buildPackageXml
in the antdestroy
task are passing the apiVersion
as the second parameter, when the function expects the package name as the second parameter.
The task also creates a non empty package.xml
which results in a redundant deploy of the package, before destroying.
Have had a go at fixing with #41
I have a password string that begins with '&yUis2' and when I attempt to use it in a deploy, I get this:
Warning:
BUILD FAILED
C:\work\salesforce_ant\OptimizeDev\node_modules\grunt-ant-sfdc\tmp\ant\build.xml:7: The reference to entity "yUis2" must end with the ';' delimiter.
Total time: 0 seconds Use --force to continue.
Aborted due to warnings.
The Ant Migration Tool allows you to specify a package name instead of a package.xml to retrieve all components that belong to that package (as defined on SFDC's server)
Please see the packageNames attribute during sf:retrieve
Hello,
I've followed your tutorial here and am receiving the following error:
Warning: Error: not found: ant Use --force to continue.
When I try and run my gruntfile. I've tried using both ENV variables and hardcoding the username and password. My configuration can be found here.
Am I doing anything wrong?
EDIT:
I believe the problem lies here: https://github.com/kevinohara80/grunt-ant-sfdc/blob/master/tasks/ant_sfdc.js#L72
My deployments are taking up to 4 minutes to deploy even though my broadband is quite average. Are there any ways to debug why it might be taking so long?
grunt-ant-sfdc could almost completely replace the force.com migration tool if it had the ability to delete items from the server. Dynamically creating destructiveChanges.xml with grunt? Superpowers.
If you use the useEnv
property, where are the env variables expected to come from? Node vars (for example, process.env.SFUSER), or should these be actual system environment variables? Could you provide an example? Thanks in advance!!
I've been trying to figure out what is happening here.. I've set everything up using the grunt-compress plugin and my configuration seems to be correct (I've double checked my credentials and everything else). What's interesting is its saying that there was a failure to send request to 'login.salesforce' when I've set test.salesforce as the server. Has anyone seen this error before?? Er.. any idea what might be going on? Could it be that I'm behind a proxy?
Any help is greatly appreciated!! Thanks in advance!!
BUILD FAILED C:\Users\****\****\********\node_modules\grunt-ant-sfdc\tmp\ant\build.xml:15: Failed to login: Failed to send request to https://login.salesforce.com/services/Soap/u/29.0
My Config...
antdeploy: {
options: {
version: '37'
},
dev1: {
options: {
user: '****@****.com.dev01',
pass: '*******',
token: '*********',
serverurl: 'https://test.salesforce.com'
},
pkg: {
staticresource: ['*']
}
}
},
Is there any way to support node-ant as an ant implementation? This would make it easier (especially for windows users) to get this up an running.
It doesn't look like this is using anything to terribly advanced so it should be pretty safe.
Kevin,
I modified my local copy of the lib/metadata.json file to include the following:
"workflowrule": {
"xmlType": "WorkflowRule",
"folder": "workflows",
"allowStar": false
},
"workflowfieldupdate": {
"xmlType": "WorkflowFieldUpdate",
"folder": "workflows",
"allowStar": false
},
"workflowalert": {
"xmlType": "WorkflowAlert",
"folder": "workflows",
"allowStar": false
},
"workflowtask": {
"xmlType": "WorkflowTask",
"folder": "workflows",
"allowStar": false
}
I did this specifically to use antdestroy to remove a mess of old legacy workflow rules. Do you think this would be valuable for the general public?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.