cartridges deploy made easy
Utility to deploy cartridges on a Salesforce Commerce Cloud instance.
npm install salesforce-deploy
import deploy from 'salesforce-deploy'
deploy({
hostname: "<sfcc-instance-hostname>",
username: "<business-manager-username>",
password: "<business-manager-password>",
cartridges: [
{ source: "<cartridges-path>" },
{ source: "<cartridges-path>", exclude: "<glob-pattern>" }
],
codeVersion: "<code-version>",
force: false
})
Parameter | Type | Mandatory | Default | Description |
---|---|---|---|---|
hostname |
String | yes | Hostname of the SFCC instance | |
username |
String | yes | Business Manager username | |
password |
String | yes | Business Manager password | |
cartridges |
String, Array | yes | Local source paths where the script will look for cartridges to deploy | |
codeVersion |
String | yes | Name of the code version to deploy | |
force |
Boolean | no | false | Flag to remove existing code version before deploy |
A Promise
fulfilled with true
if deploy process succeded, otherwise false
.
import deploy from 'salesforce-deploy'
let deployed
try {
deployed = await deploy({
hostname: "dev01-realm-customer.demandware.net",
username: "bm_user",
password: "bm_pass",
cartridges: "./cartridges/project_1",
codeVersion: "v1.0.0-rc.0"
})
} catch (e) {
deployed = false
}
console.log(deployed) // true for sure!
import deploy from 'salesforce-deploy'
let deployed
try {
deployed = await deploy({
hostname: "dev01-realm-customer.demandware.net",
username: "bm_user",
password: "bm_pass",
cartridges: [
{ source: "./cartridges/project_1" },
{ source: "./cartridges/project_2", exclude: "**/{cart,checkout/**" } // `exclude` property value must be a glob pattern
],
codeVersion: "v1.0.0-rc.0"
})
} catch (e) {
deployed = false
}
console.log(deployed) // true for sure!
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
MIT. Copyright (C) 2018, 2019 Francesco Pasqua.