Skip to content

Instantly share code, notes, and snippets.

@intel352
Created November 2, 2016 22:29
Show Gist options
  • Save intel352/9e890d327b99851770cef225d1a430c0 to your computer and use it in GitHub Desktop.
Save intel352/9e890d327b99851770cef225d1a430c0 to your computer and use it in GitHub Desktop.

dwupload

Upload a storefront cartridge to a Demandware WebDAV server from command line.

Installation

:; npm install -g bitbucket:demandware/dwupload

Instead of installing this as a global npm package, you can install it locally and access it as ./node_modules/.bin/dwupload.

Note: this npm command above requires the lastest version of npm (or at least 2.x). If you do not have that, run npm install -g npm first.

Usage

:; dwupload --hostname example.demandware.net --username admin --password password --cartridge app_storefront_core  --code-version version1 # uploading a carridge
:; dwupload --file path/to/app.js --file path/to/style.css # uploading file(s) using configuration in `dw.json`
:; dwupload watch --cartridge app_storefront_controllers # watch for file changes and upload automatically
:; dwupload delete --file rootDir/path/to/file --root rootDir # delete a file, with root option

See --help for more information.

Exclude patterns

Exclude patterns can be declared via the -x or --exclude flag. This work for both file and folder exclude patterns. For example:

*.swp
**/node_modules/**

Please note that the ** after the folder name is important. Without it, child directories of node_modules would still be included.

Config file

Instead of passing command line options every single time, you can store your config options in a dw.json file in the current working directory instead. For example:

{
        "hostname": "example.demandware.net",
        "username": "user",
        "password": "password",
        "cartridge": ["cartridgeA", "cartridgeB"],
        "code-version": "version2"
}

Command line options will always override the options delcared in the config file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment