Skip to content

Commit dbf1586

Browse files
Merge pull request #761 from sf-pallavi-das/u/pallavi-das/W-19887188_Updating_wait_time_master
@W-19887188 Changing wait time for mdapi:deploy command
2 parents 93cdcef + 3cb4500 commit dbf1586

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ The Job file additionally supports some Vlocity Build based options and the opti
810810
| useAllRelationships | Determines whether or not to store the _AllRelations.json file which may not generate consistently enough for Version Control. Recommended to set to false. | Boolean | true |
811811
| useVlocityTriggers | Turn on / off Vlocity's AllTriggers Custom Setting during the Deploy | Boolean |true |
812812
| disableVlocityTriggers | Turn off Vlocity's AllTriggers Custom Setting during the Deploy | Boolean |false |
813+
| wait | Wait time in minutes for SFDX/SF CLI deployment commands. Used with useSfdxCli option. Note: Infinite wait time(-1) is not supported by SFDX anymore, so a specific wait time must be provided. | Integer | 33 |
813814
| ignoreLWCActivationOS | Do not compile and deploy LWC OmniScripts | Boolean |false |
814815
| ignoreLWCActivationCards | Do not compile and deploy LWC Cards | Boolean |false |
815816
| lwcCompilerNamespace | Overrides the namespace of the installed managed package. Useful when using a developer org. Options: vlocity-cme, vlocity-ins, vlocity-ps | String | - |
@@ -844,6 +845,7 @@ The Job file additionally supports some Vlocity Build based options and the opti
844845
| sf.username | Salesforce username when using sf.password | String | none |
845846
| type | DataPack Type used for packExportSingle command | String | none |
846847
| verbose | Show additional logging statements | Boolean | false |
848+
| wait | Wait time in minutes for SFDX/SF CLI deployment commands. Overrides job file wait setting | Integer | 33 |
847849

848850
# Developer Workflow
849851
When developing on a large project, exporting DataPacks through Queries is not the ideal process. Instead, each developer should keep track of the major items that they are working on and extract those items as needed to commit to Version Control.

lib/datapacksjob.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2801,7 +2801,7 @@ DataPacksJob.prototype.deployJob = async function(jobInfo) {
28012801
const mdapiDeployResult = await sfdxCommandRunner('mdapi:deploy', {
28022802
deploydir: mdapiTempFolder,
28032803
targetusername: this.vlocity.sfdxUsername,
2804-
wait: -1,
2804+
wait: jobInfo.wait || 33,
28052805
useSfCli: jobInfo.useSfCli,
28062806
useSfdxCli: jobInfo.useSfdxCli
28072807
});

lib/sfdx.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ const _sourceConvert = async (rootdir, outputdir, useSfdxCli) => {
3131
_run(` sf project convert source --root-dir "${rootdir}" --output-dir "${outputdir}"`);
3232
}
3333

34-
const _mdapiDeploy = async (targetusername, deploydir, useSfdxCli) => {
35-
return useSfdxCli ? _run(`sfdx force:mdapi:deploy --deploydir "${deploydir}" --targetusername "${targetusername}" -w -1 --verbose`) :
36-
_run(`sf project deploy start --metadata-dir "${deploydir}" --target-org "${targetusername}" --verbose`);
34+
const _mdapiDeploy = async (targetusername, deploydir, useSfdxCli, wait = 33) => {
35+
return useSfdxCli ? _run(`sfdx force:mdapi:deploy --deploydir "${deploydir}" --targetusername "${targetusername}" -w ${wait} --verbose`) :
36+
_run(`sf project deploy start --metadata-dir "${deploydir}" --target-org "${targetusername}" --wait ${wait} --verbose`);
3737
}
3838

3939
const _orgDisplay = async (targetusername) => {
@@ -83,7 +83,7 @@ const run = async(command, options) => {
8383
if (command === 'source:convert') {
8484
return _sourceConvert(options.rootdir, options.outputdir, options.useSfdxCli);
8585
} else if (command === 'mdapi:deploy'){
86-
return _mdapiDeploy(options.targetusername, options.deploydir, options.useSfdxCli);
86+
return _mdapiDeploy(options.targetusername, options.deploydir, options.useSfdxCli, options.wait);
8787
} else if (command === 'org display'){
8888
return _orgDisplay(options.targetusername);
8989
} else if (command === 'source:deploy'){

lib/vlocitycli.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ var VLOCITY_COMMANDLINE_OPTIONS = {
110110
"ignoreLocalCompilationCards": Boolean,
111111
"puppeteerHttpProxy": String,
112112
"overrideOrgCommit": String,
113-
"keepOSActiveWhenLWCDeploymentFails": Boolean
113+
"keepOSActiveWhenLWCDeploymentFails": Boolean,
114+
"wait": Number
114115
};
115116

116117
var VLOCITY_COMMANDLINE_OPTIONS_SHORTHAND = {

0 commit comments

Comments
 (0)