GithubHelp home page GithubHelp logo

jenssimon / sfcc-deploy Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 1.0 796.05 MB

Deploy cartridges to a Salesforce Commerce Cloud (SFCC) instance

License: MIT License

TypeScript 58.53% JavaScript 41.47%
sfcc demandware salesforce commercecloud sfra deploy

sfcc-deploy's Introduction

NPM version Downloadsstar this repo fork this repo CI

sfcc-deploy

Deploy cartridges to a Salesforce Commerce Cloud (SFCC) instance.

Warning

DEPRECATED

The recommended way to deploy code to SFCC instances is direct via sfcc-ci.

Screenshot

Installation

$ yarn add sfcc-deploy --dev

General

Uploads a set of SFCC cartridges to an instance. Additionally you can extend it with additional tasks.

Usage

The credentials object is the same as the config for dwdav.

import sfccDeploy from 'sfcc-deploy'

const config = {
  hostname: 'host.name.net',
  username: 'login',
  password: 'password',
  p12: 'path/to/cert.p12', // two factor authentication
  passphrase: 'certpassphrase', // two factor authentication
}

const version = '0.5.1'

try {
  await sfccDeploy({
    credentials: config,
    version,

    root: './dist/', // default: './dist/'
  })
} catch (e) {
  console.error('error', e)
}

It's also possible to add additional tasks (executed after code upload).

const activateCodeVersion = {
  name: ({ options: { version } }) => `Activating code version: ${version}`, // also takes a simple string
  condition: 'activateCodeVersion', // the flag name needed to active the task
  emoji: 'fast_forward',
  fn: (params) => {
    // ...
  },
}

try {
  await sfccDeploy({
    credentials: config,
    version,

    activateCodeVersion: true, // this flag is needed to activate the additional step
    additionalSteps: [
      activateCodeVersion,
    ],
  })
} catch (e)  {
  console.error('error', e)
}

The emoji name must one of the available emojis from this list. Following information are passed as object to the name and fnfunctions:

Property Description
options The config object of the sfccDeploy() call
dwdav The dwdav instance used for upload
rootDir The root directory
step The current step (see https://www.npmjs.com/package/cli-step#a-single-step-%EF%B8%8F)
stepText The text of the step

License

MIT © 2023 Jens Simon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.