Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.
/ salesforce-deploy Public archive

Utility to deploy cartridges on a Salesforce Commerce Cloud instance

License

Notifications You must be signed in to change notification settings

cesconix/salesforce-deploy

Repository files navigation

⚠️ Archived Repository: This project is no longer maintained and is kept here for archival purposes only. Please note that the code may be outdated and no longer functional.

Salesforce Deploy

cartridges deploy made easy

build status npm version dependencies devDependencies vulnerabilities coverage javascript style guide conventional commits

Utility to deploy cartridges on a Salesforce Commerce Cloud instance.

Installation

npm install salesforce-deploy

Usage

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
})

Parameters

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

Returns

A Promise fulfilled with true if deploy process succeded, otherwise false.

Example - Deploy cartridges from a single folder

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!

Example - Deploy cartridges from multi folder

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!

Contributing

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.

License

MIT. Copyright (C) 2018, 2019 Francesco Pasqua.

About

Utility to deploy cartridges on a Salesforce Commerce Cloud instance

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published