Upload Code for SFRA
You can use the SFRA command-line upload tool to upload your code.
- 
In the cartridge you want to upload, locate, or create a 
dw.jsonfile.Thedw.jsonfile is automatically created if thesgmf-scriptscreateCartridgebuild tool command is used to create the cartridge. However, for some cartridges, such as theapp_storefront_baseandmodulescartridges provided by B2C Commerce, you must create thedw.jsonfile and add it to the cartridge. Create thedw.jsonfile in the top-level folder of the repository, as a sibling of thecartridgesdirectory.Thedw.jsonfile contains the information required to establish a server connection and the code version to upload your cartridges to.{ "hostname": "yoursandbox-inside-your-realm.demandware.net", "username": "yourusername", "password": "yourpwd", "code-version": "version1" }CAUTION:This file is normally unencrypted. However, because it contains the instance and password data necessary to upload code, you can use extra measures to secure it. - 
To upload the code, use the applicable command.
- 
To upload all cartridges for the repository, use
uploadCartridge:npm run uploadCartridge - 
To upload a specific cartridge, use
uploadCartridgewith the name of the cartridge:npm run uploadCartridge mycartridge - 
To upload a single file, use
upload.If you use the same commands as the app_storefront_base cartridge, run:npm run upload path/to/my/filename.ext - 
To detect changes to files in your cartridge and automatically upload them to the server, use
watch.If you use the same commands as theapp_storefront_basecartridge, run:npm run watchThe
watchcommand makes it simple to keep the code on your sandbox instanace up-to-date. 
 - 
 - 
Make sure that your code is actually on the server:
- Select Administration > Site Development > Code Deployment.
 - 
Click the Code Version link for the code version you
specified in the 
dw.jsonfile.If your cartridge was uploaded successfully, it appears in the list of cartridges on the Version Summary page. 
 
The command-line watch and upload commands are wrappers
for the Dwupload project. Download the project from GitHub if you want to
contribute.
Infocenter Retirement: On June 30, 2023, the Infocenter was retired, and documentation currently hosted on the Infocenter will be published to Salesforce Help, Commerce Cloud Developer Center, and Salesforce B2C Commerce Developer Documentation Resources. For more information, see the release note.