# sfcc-deploy

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

Latest version **3.5.0** (published 2024-02-27) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install sfcc-deploy
pnpm add sfcc-deploy
yarn add sfcc-deploy
bun add sfcc-deploy
```

Provides the command `sfcc-deploy`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.5.0 |
| Published | 2024-02-27 |
| First published | 2019-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 47.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 9 |
| Author | Jens Simon |
| Maintainers | jenssimon |
| Keywords | sfcc, demandware, salesforce, commercecloud, sfra, deploy |

## Links

- npm: https://www.npmjs.com/package/sfcc-deploy
- Repository: https://github.com/jenssimon/sfcc-deploy
- Homepage: https://github.com/jenssimon/sfcc-deploy#readme
- Issues: https://github.com/jenssimon/sfcc-deploy/issues
- npm.io page: https://npm.io/package/sfcc-deploy

## Dependencies (6)

- [chalk](https://npm.io/package/chalk.md) ^4.1.2
- [dwdav](https://npm.io/package/dwdav.md) >=3.5.1
- [archiver](https://npm.io/package/archiver.md) ^5.3.2
- [cli-step](https://npm.io/package/cli-step.md) ^1.0.2
- [commander](https://npm.io/package/commander.md) ^12.0.0
- [camel-case](https://npm.io/package/camel-case.md) ^4.1.2

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 3.5.0 (latest) — 2024-02-27
- 3.4.1 — 2024-02-12
- 3.4.0 — 2023-10-14
- 3.3.1 — 2023-08-17
- 3.3.0 — 2023-06-26
- 3.2.2 — 2023-04-15
- 3.2.1 — 2023-02-02
- 3.2.0 — 2023-01-29
- 3.1.3 — 2023-01-21
- 3.1.2 — 2022-05-23
- 3.1.1 — 2022-05-19
- 3.1.0 — 2021-09-17
- 3.0.1 — 2021-06-18
- 3.0.0 — 2021-03-01
- 2.1.0 — 2020-03-27
- … 8 more at https://npm.io/package/sfcc-deploy/versions

## README

[![NPM version][npm-image]][npm-url] [![Downloads][npm-downloads-image]][npm-url][![star this repo][gh-stars-image]][gh-url] [![fork this repo][gh-forks-image]][gh-url] [![CI][gh-status-image]][gh-status-url]

# 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](https://github.com/SalesforceCommerceCloud/sfcc-ci?tab=readme-ov-file#pushing-code).

![Screenshot](https://github.com/jenssimon/sfcc-deploy/raw/main/deploy.gif)

## Installation

```sh
$ 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](https://www.npmjs.com/package/dwdav#config).

```javascript
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).

```javascript
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](https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json).
Following information are passed as object to the `name` and `fn`functions:

Property   | Description
-----------|------------
`options`  | The config object of the `sfccDeploy()` call
`dwdav`    | The [dwdav](https://www.npmjs.com/package/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](https://github.com/jenssimon)

[npm-url]: https://www.npmjs.com/package/sfcc-deploy
[npm-image]: https://badgen.net/npm/v/sfcc-deploy
[npm-downloads-image]: https://badgen.net/npm/dw/sfcc-deploy

[gh-url]: https://github.com/jenssimon/sfcc-deploy
[gh-stars-image]: https://badgen.net/github/stars/jenssimon/sfcc-deploy
[gh-forks-image]: https://badgen.net/github/forks/jenssimon/sfcc-deploy
[gh-status-image]: https://github.com/jenssimon/sfcc-deploy/actions/workflows/ci.yml/badge.svg
[gh-status-url]: https://github.com/jenssimon/sfcc-deploy/actions/workflows/ci.yml

---
_Source: https://npm.io/package/sfcc-deploy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
