Skip to content

Commit acdd38d

Browse files
author
Adam Rutland
committed
Add manually updated Version. Update Readme.
1 parent 0391a14 commit acdd38d

File tree

3 files changed

+54
-21
lines changed

3 files changed

+54
-21
lines changed

README.md

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44
Vlocity Build is a command line tool to export and deploy Vlocity DataPacks in a source control friendly format through a YAML Manifest describing your project. Its primary goal is to enable Continuous Integration for Vlocity Metadata through source control. It is written as a Node.js Command Line Tool.
55

6-
### Table of Contents
6+
## Table of Contents
77
* [Installation Instructions](#installation-instructions)
88
* [Getting Started](#getting-started)
99
* [Step by Step Guide](#step-by-step-guide)
10-
* [Simple Export](#simple-export)
11-
* [Simple Deploy](#simple-deploy)
12-
* [Org to Org Migration](#org-to-org-migration)
10+
* [Simple Export](#simple-export)
11+
* [Simple Deploy](#simple-deploy)
12+
* [Org to Org Migration](#org-to-org-migration)
1313
* [The Job File](#the-job-file)
1414
* [Example Job File](#example-job-file)
1515
* [Troubleshooting](#troubleshooting)
@@ -22,16 +22,17 @@ Vlocity Build is a command line tool to export and deploy Vlocity DataPacks in a
2222
# Installation Instructions
2323
-----------
2424

25-
## Install Node.js
26-
Download and Install Node at:
27-
https://nodejs.org/
25+
## Install Node.js
26+
Download and Install Node at:
2827

29-
This project requires Node Version 8+.
28+
https://nodejs.org/
3029

31-
Use `node -v` to find out which version you are on.
30+
This project requires Node Version 8+.
3231

33-
Inside the Git repository you have cloned run the following command:
34-
```bash
32+
Use `node -v` to find out which version you are on.
33+
34+
Inside the Git repository you have cloned run the following command:
35+
```bash
3536
npm install
3637
npm link
3738
vlocity help
@@ -43,8 +44,8 @@ This should show a list of all available commands confirming that the project ha
4344
------------
4445
To begin, create your own property files for your Source and Target Salesforce Orgs with the following:
4546
```java
46-
sf.username: <Salesforce Username>
47-
sf.password: <Salesforce Password>
47+
sf.username: <Salesforce Username>
48+
sf.password: <Salesforce Password>
4849
```
4950
When you (or your CI/CD server) is behind a proxy you can specify the proxy URL with a Username and password by adding the below line to your property file:
5051
```java
@@ -54,7 +55,7 @@ sf.httpProxy: http://[<Proxy server Username>:<Proxy server Password>@]<Proxy ho
5455
It is best to not rely on a single build.properties file and instead use named properties files for each org like `build_source.properties` and `build_target.properties`
5556

5657
## Running the Process
57-
Commands follow the syntax:
58+
Commands follow the syntax:
5859
```bash
5960
vlocity packExport -propertyfile <filepath> -job <filepath>
6061
```
@@ -64,7 +65,7 @@ The propertyfile is used to provide the credentials of the org you will connect
6465
## Job File
6566
The Job File used to define the project location and the various settings for running a DataPacks Export / Deploy.
6667

67-
Step by Step Guide
68+
# Step by Step Guide
6869
------------
6970
Once you have your `build_source.properties` file setup, you can get started with mirgation with the following:
7071

@@ -442,6 +443,25 @@ manifest:
442443
443444
**Due to the limitation that not all DataPackTypes support the manifest format. It is best to use the Export by Queries syntax**
444445
446+
## Advanced: Export Individual SObject Records
447+
You can export individual SObjects by using the VlocityDataPackType SObject. This will save each SObject as its own file.
448+
449+
```bash
450+
vlocity packExport -type SObject -query 'SELECT Id from PricebookEntry WHERE Id in ('01u0a00000I4ON2AAN', '01u0a00000I4ON2AAN')"
451+
```
452+
453+
This will export the PricebookEntries into a folder called SObject_PricebookEntry.
454+
455+
This method is also very good for adding Custom Settings to Version Control, however it requires creating Matching Key Records for your Custom Setting. See [Creating Custom Matching Keys] (#creating-custom-matching-keys) for more information on Matching Keys. You can specify a Custom Setting in your job file as follows:
456+
457+
```yaml
458+
queries:
459+
- VlocityDataPackType: SObject
460+
query: Select Id from MyCustomSetting__c'
461+
```
462+
463+
This will export the MyCustomSetting__c records into a folder called SObject_MyCustomSetting.
464+
445465
## BuildFile
446466
This specifies a File to create from the DataPack Directory. It could then be uploaded through the DataPacks UI in a Salesforce Org.
447467
```yaml
@@ -674,6 +694,8 @@ DataPacks uses a Custom Metadata Object called a Vlocity Matching Key to define
674694

675695
Create these keys if you want to support connections between SObject Id fields that are not already supported by DataPacks, or if you would like to change the Vlocity Default for any SObject. Matching Keys created outside the Managed Package will always override ones contained inside (Post Vlocity v15).
676696

697+
For Custom Settings `MatchingKeyFields__c` should always be `Name`.
698+
677699
### Current Matching Keys
678700
| Object API Name | Matching Key Fields |
679701
| --- | --- |

lib/vlocitycli.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ var notifier = require('node-notifier');
88
var properties = require('properties');
99
var stringify = require('json-stable-stringify');
1010

11+
var VERSION = '1.3.0';
12+
1113
var VLOCITY_COMMANDLINE_OPTIONS = {
1214
"activate": Boolean,
1315
"addSourceKeys": Boolean,
@@ -50,7 +52,8 @@ var VLOCITY_COMMANDLINE_OPTIONS = {
5052
"json-test": Boolean,
5153
"nojob": Boolean,
5254
"sandbox": Boolean,
53-
"json-pretty": Boolean
55+
"json-pretty": Boolean,
56+
"version": Boolean
5457
};
5558

5659
var VLOCITY_COMMANDLINE_OPTIONS_SHORTHAND = {
@@ -189,10 +192,12 @@ VlocityCLI.prototype.runCLI = function(commands, success, error) {
189192

190193
self.commandLineOptions = nopt(VLOCITY_COMMANDLINE_OPTIONS, VLOCITY_COMMANDLINE_OPTIONS_SHORTHAND, process.argv, 2);
191194

192-
var commands = commands || self.commandLineOptions.argv.remain;
195+
commands = commands || self.commandLineOptions.argv.remain;
193196

194197
self.isJsonCLI = self.optionOrProperty('json') || self.optionOrProperty('json-pretty') || self.optionOrProperty('json-test') || false;
195198

199+
VlocityUtils.log('Vlocity Build v' + VERSION);
200+
196201
self.isJsonCLIPretty = self.optionOrProperty('json-pretty') || self.optionOrProperty('json-test') || false;
197202

198203
self.stack = self.optionOrProperty('stack');
@@ -207,7 +212,7 @@ VlocityCLI.prototype.runCLI = function(commands, success, error) {
207212
if (self.isJsonCLI) {
208213
return success(self.formatResponseCLI({ message: 'Vlocity Build', records: [], action: 'none', status: 'success' }));
209214
} else {
210-
return success('Vlocity Build');
215+
return success('');
211216
}
212217
} else if (commands[0] == 'help') {
213218
VlocityUtils.log('All available commands:');

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"grunt": "0.4.5",
2020
"grunt-cli": "1.2.0",
2121
"mocha": "^5.0.0",
22-
"pkg": "4.2.0"
22+
"pkg": "^4.2.0"
2323
},
2424
"engines": {},
2525
"license": "MIT",
@@ -33,10 +33,16 @@
3333
"test/**/*",
3434
"javascript/*",
3535
"lib/*.json",
36+
"lib/*.yaml",
3637
"dataPacksJobs/*"
3738
],
3839
"scripts": [
3940
"lib/*.js"
41+
],
42+
"targets": [
43+
"win-x64",
44+
"win-x86",
45+
"macos"
4046
]
4147
},
4248
"repository": {
@@ -54,7 +60,7 @@
5460
"runJavaScript": "vlocity runJavaScript -job DataPacksJob.yaml",
5561
"test": "vlocity runTestJob",
5662
"unitTest": "mocha test/**/**.spec.js",
57-
"build": "pkg . --out-path ./bin"
63+
"build": "pkg . --out-path ./bin"
5864
},
59-
"version": "1.1.0"
65+
"version": "1.3.0"
6066
}

0 commit comments

Comments
 (0)