npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@borngroup/born-sfcc-ci

v2.2.1

Published

BORN Group's CI/CD tooling for Salesforce Commerce Cloud

Downloads

674

Readme

BORN SFCC CI

The BORN SFCC CI is a command-line interface to interact with your project's Commerce Cloud instances. It provides functionality to facilitate CI/CD practices. This project wraps Salesforce Commerce Cloud's CLI, the B2C Commerce Developer Sandbox REST API (DOC), and OCAPI.

Getting Started

In order to perform CLI commands, you have to permit API calls to your Commerce Cloud instances. There are three steps required:

  1. Set up a Commerce Cloud API key through Account Manager (or contact the technical admins on your project for existing API client credentials)
  2. Configure Open Commerce API Settings
  3. Configure WebDAV Client Permissions

Please see SFCC-CI: How do I get set up? for up to date environment setup steps.


Installation and Project Setup

Install the NPM package

BORN SFCC CI is an NPM package. It can be installed with the command:

npm install @borngroup/born-sfcc-ci --save-dev

NOTE: For Windows users, one additional step is required -- since born-sfcc-ci is installed locally, you'll need to add path\to\project\node_modules\.bin to the PATH environment variable in order to execute it without specifying the full path. Alternatively, you can install it globally with npm install -g @borngroup/born-sfcc-ci.

Configurations

Configurations can be done in one of three places:

  1. In environment variables
  2. In a dw.json file
  3. As command line arguments

The list above is in order of precedence. For example, if the same configuration exists in both environment variables, as well as in dw.json, then dw.json will take precedence over the environment variable. If a configuration exists in both dw.json, and was passed in as a CLI argument, the CLI argument will take precedence.

Here is a table showing the key or property name in each of the three modes of configuration:

| Environment Variable | dw.json file | CLI Argument | | --------------------------- | -------------- | ---------------- | | BORN_SFCC_CI_CLIENT_ID | client-id | --client-id | | BORN_SFCC_CI_CLIENT_SECRET | client-secret | --client-secret | | BORN_SFCC_CI_HOSTNAME | hostname | --hostname | | BORN_SFCC_CI_VERSION | version | --code-version | | BORN_SFCC_CI_DATA_BUNDLE | data-bundle | --data-bundle | | BORN_SFCC_CI_DATA_HOSTNAMES | data-hostnames | --data-hostnames | | BORN_SFCC_CI_CODE_HOSTNAMES | code-hostnames | --code-hostnames |

Create a dw.json

BORN SFCC CI supports a valid dw.json in the root directory. This is the most common mode of configuring the tool for developers. The dw.json provides the credentials and environmental setting needed to issue commands against your Commerce Cloud instances.

dw.json

{

  "username": "[email protected]",
  "password": "account-manager-password!123",
  "client-id": "project-cicd-client-id",
  "client-secret": "project-cicd-client-secret",
  "hostname": "my-instance.sandbox.us01.dx.commercecloud.salesforce.com",
  "version": "myversion",
  "data-bundle": "sandbox",
  "data-hostnames": ["my-instance01.com", "my-instance02.com"], // added for usage by the technical lead; can be omitted by developers.
  "code-hostnames": ["my-instance01.com", "my-instance02.com"] // added for usage by the technical lead; can be omitted by developers.

}

dw.json properties

  • username: Your SFCC Account Manager username. This is required.
  • password: Your SFCC Account Manager password. This is required
  • client-id: A valid Commerce Cloud API client id which will be provided by a technical admin (most likely the TL of your project). This is required for code activation and data deployment.
  • client-secret: A valid Commerce Cloud API client secret which will be provided by an technical admin (most likely the TL of your project). This is required for code activation and data deployment.
  • hostname: The hostname of your Commerce Cloud instance. This is required. Always pass the non-cert hostname, even when deploying to staging.
  • version: Your code version. Typically, your first initial + last name i.e., jdoe. This is required for code activation and upload.
  • data-bundle: A data bundle to deploy. The available data bundles are defined in site_data/config.json. Each bundle references a set of data directories to upload and import into your instance. This is required for data deployment.
  • data-hostnames: An array of hostnames pointing to Commerce Cloud instances. This allows deployment of data to multiple instances at once. This is an optional property for TL usage and should be removed to avoid accidental data deployments to other sandoxes than your own. When it is present, it will take precedence over the hostname property.
  • code-hostnames: An array of hostnames pointing to Commerce Cloud instances. This allows deployment of data to multiple instances at once. This is an optional property for TL usage and should be removed to avoid accidental data deployments to other sandoxes than your own. When it is present, it will take precedence over the hostname property.

Configure site_data

BORN SFCC CI uses the site_data directory in the root directory for data deployment.

See https://bitbucket.org/borngroup/sfcc-accelerators/src/master/site_template/readme.md

Usage

Invoke the help command for up to date usage information

born-sfcc-ci help
born-sfcc-ci help <command>

Tasks

Activate Code

Activate a code version specified in your configurations on your Commerce Cloud instance. This can be useful when beginning development to ensure your code version is active.

born-sfcc-ci activate-code

Clear Auth Token

Deletes the locally cached auth token. Useful for after changing credentials.

born-sfcc-ci clear-auth-token

Deploy Code

Compress and upload a set of cartridges to your Commerce Cloud instance. It uploads all cartridges within the /cartridges directory. This action also checks the B2C Instance for an old code version with the same name. If that exists, it will delete it prior to upload.

born-sfcc-ci deploy-code

Deploy Data

Compress, upload, and import a set of data archives to your Commerce Cloud instance. Using the data-bundle property, this command identifies and deploys the corresponding data folders in the site_data/config.json file.

born-sfcc-ci deploy-data