sfdc-extended-metadata
v1.6.0
Published
Retrieve data from SFDC and split to many files
Downloads
43
Readme
sfdc-extended-metadata
Inspired from sfdc-generate-package by Sebastien Colladon
/!\ The Gulp Sequence functionality doesn't work /!\
sfdc-extended-metadata
is a package to add mor functionalities to jsforce-metadata-tools
.
Why ?
There are many Salesforce project using versionning. Theses projects used the Metadata API.
It's perfect for classes ou tiggers but not for the CustomObject or CustomLabel because to send to Salesforce we need to tell what information contain the CustomObject.
sfdc-extended-metadata
split the metadata to small part of metadata.
Getting Started
Installing
$ cd /your//repo
$ git clone https://github.com/baptistebieber/sfdc-extended-metadata.git
# Or :
$ wget https://github.com/baptistebieber/sfdc-extended-metadata/archive/master.zip
$ unzip master.zip
# Then :
$ npm install
Tasks prepackaged
"scripts": {
"retrieve": "gulp retrieve",
"deploy": "gulp deploy",
"parse-data": "gulp parse-data",
"compose-data": "gulp compose-data",
"generate-package": "gulp generate-package"
}
- retrieve: Retrieve data from the
SF_SRC + /package.xml
(or from a file passed using relative path with the option-p
or-package
) toSF_TMP
- deploy: Deploy data from
SF_TMP
- parse-data: Parse data (split) from
SF_TMP
toSF_SRC
- compose-data: Combine data from
SF_SRC
toSF_TMP
- generate-package: Generate
package.xml
fromSF_TMP
Methods available
"scripts": {
"deploy": deploy,
"retrieve": retrieve,
"gulpRetrieve": gulpRetrieve,
"gulpDeploy": gulpDeploy,
"parseData": parseData,
"composeData": composeData,
"generatePackage": generatePackage,
"generatePackageFromList": generatePackageFromList,
"diff": diff,
"selectFromPackage": selectFromPackage,
}
deploy
retrieve: Retrieve data from the
SF_SRC + /package.xml
(or from a file passed using relative path with the option-p
or-package
) toSF_TMP
parse-data: Parse data (split) from
SF_TMP
toSF_SRC
compose-data: Combine data from
SF_SRC
toSF_TMP
generate-package: Generate
package.xml
fromSF_TMP
deploy: Deploy data from a folder (
packageSrc
)retrieve: Retrieve data from a package.xml (
packageXmlPath
) to a folder (folderToExtract
)parseData: Split & move metadata from a folder (
inputFolder
) to an other (outputFolder
)composeData: Merge & move metadata from a folder (
inputFolder
) to an other (outputFolder
)generatePackage: Generate file "package.xml" from all metadata parsed from a folder (
inputFolder
) to a folder (outputFolder
)generatePackageFromList: Generate file package.xml (
outputFile
) from a list of filepath (filepaths
) in a folder (inputFolder
)diff: Make a diff between commit or branch (
commitFrom
) and an other (commitTo
) into the local repository path (repo
) and move and compose data from (inputFolder
) to (outputFolder
)selectFromPackage: Not working yet Select files from a specific package.xml file (
inputPackage
) from a folder (inputFolder
) to an other (outputFolder
)
Usage Example
Retrieve data and parse
You need to have the file package.xml
into the SRC folder.
Then:
$ gulp retrieve
$ gulp parse-data
After having done modifications: deploy
$ gulp compose-data
$ gulp generate-package
$ gulp deploy
Retrieve data from a specific package
You need to have the file ./package-perso.xml
into the SRC folder.
Then:
$ gulp retrieve -p ./package-perso.xml
Configuration
copy the .env_sample file to a .env file in the root directory. It contains the definition of each required parameters with aen example value. Here is what each line is used for and where:
SF_VERSION Used for: defining the Salesforce API version used Type of value: float one decimal precision (ex: 43.0) Used in:
- retrieve
- deploy
- generate-package
SF_USERNAME Used for: connecting to Salesforce Type of value: string email format Used in:
- retrieve
- deploy
SF_PASSWORD Used for: connecting to Salesforce. Combine Password + Token Type of value: string Used in:
- retrieve
- deploy
SF_SERVERURL Used for: connecting to Salesforce Type of value: string url format Used in:
- retrieve
- deploy
SF_SRC_PATH Used for: defining the path to the src folder Type of value: string absolute or relative path from this folder Used in:
- retrieve
- deploy
- generate-package
- parse-data
- compose-data
SF_TMP_PATH Used for: defining the path to the temporary folder Type of value: string absolute or relative path from this folder Used in:
- retrieve
- deploy
- generate-package
- parse-data
- compose-data
Here is the list of optional parameters with their default value :
- SF_VERBOSE : (boolean) used in deploy. Default: true
Built With
- archiver - A streaming interface for archive generation.
- decompress - Extracting archives made easy.
- directory-tree - Creates a JavaScript object representing a directory tree.
- envalid - Environment variable validation for Node.js.
- fancy-log - Log things, prefixed with a timestamp.
- fs-extra - extra methods for the fs object like copy(), remove(), mkdirs().
- gulp - The streaming build system.
- gulp-jsforce-exec-anon - Execute anonymous using JSforce.
- gulp-load-plugins - Automatically load in gulp plugins.
- gulp-rename - Rename files easily.
- gulp-sequence - Run a series of gulp tasks in order.
- gulp-zip - ZIP compress files.
- jsforce-metadata-tools - Tools for deploying/retrieving package files using Metadata API via JSforce.
- list-filepaths - Asynchronously return an array containing the paths of all files in a directory and its subdirectories.
- merge - Merge multiple objects into one.
- plugin-error - Error handling for Vinyl plugins.
- sfdc-generate-package - Generation of the package.xml.
- sfdc-authent-delegate - Authentication delegate for Salesforce.
- through2 - A tiny wrapper around Node streams.
- xml2js - Simple XML to JavaScript object converter.
- xmlbuilder - An XML builder for node.js similar to java-xmlbuilder.
Versioning
SemVer is used for versioning.
Authors
- Baptiste Bieber - Initial work - baptistebieber
Special Thanks
- Sebastien Colladon - Base of the structure - scolladon
License
This project is licensed under the MIT License - see the LICENSE.md file for details