4 ways to sync your code with the sandbox

One of most annoying problems with Demandware I had is the code deployment. In order to execute your code on а sandbox, you have to upload it using... WebDav! I have spent thousand of hours debugging issues that turned out to be caused by corrupted uploads and/or old code version being deployed on the sandbox. Also, pipeline "building" process before upload took hours of UX Studio to complete. Unfortunately there are many possible solutions for code synchronization over WebDav, but each of them has some downsides. Which one to use? Read the list bellow and choose the one that best suits to your needs!

UX Studio

UX Studio is IDE based on Eclipse, provided for free by Salesforce. It is the officially recommended tool for code edit and deployment. It features auto upload on code change (including external changes), cleanup, boilerplate cartridges (including Sitegenesis).

Pros:

  • Auto upload
  • Option to listen for external changes: while Eclipse is running, you can use <<any>> editor to edit your JavaScript files while UX Studio handles the uploads. You need to go to Window -> Preferences -> General -> Workspace -> tick "Refresh using native hooks or polling"
  • Cleanup function (delete and reupload all cartridges)

Cons:

  • Sandbox credentials are stored for limited time (it is configured up to 6 hours). After that period of time, you need to re-enter your sandbox password. The tricky moment is that sometimes password expires, but Eclipse does not prompt you to re-enter your credentials again until you restart it. You may spend hours debugging issues until you realize that the code is just not uploaded.
  • Interface is archaic, ugly and not friendly at all.
  • Resource heavy and memory hog

More info here.

Prophet Debugger

The one and only Demandware extension for Visual Studio Code. It bundles debugger, ISML template parser, uploader and much more. Check it out here.

Pros:

  • Free and easy to install and configure
  • Handles external changes such as webpack builds or changing git branch
  • Cleanup feature
  • Selective upload (you may list only the cartridges you work on to be monitored for changes)

Cons:

  • It needs a restart often in order to continue uploading files
  • By default, deletes all cartridges on the server and reupload it on startup, which takes ages
  • The extension is often broken after update
  • Credentials are stored in plain text

davos

Davos is a WebDav client which is well suited to upload and sync your Cloud Commerce Digital projects. It fully mimics the usage of Eclipse Demandware server configurations featuring profiles and synchronization on file change. It is written in node.js which means - slow, buggy and inexplicable popular.

Pros:

  • It is command line (CLI) tool that works on all platforms
  • It does not force you to use particular editor
  • Easy setup

Cons:

  • It monitors for changes with noticeable lag which may lead to race conditions
  • Credentials are stored in plain text

Mounting WebDav

Windows allows you to mount WebDav folder as drive letter. It is native functionality, you don't need to install any 3rd party software. Sadly, it does not work on my machine because some Windows 7 security patches broke the functionality. If you have this problem too, you can use 3rd party software like NetDrive or Mountain Duck.

On Linux, you can use davfs to mount a WebDAV resource in a directory. It is really easy to configure. I have no experience with Mac, but I am pretty sure WebDav is supported, too.

The basic idea is that you can browse the files on Sandbox as they are stored locally on your harddrive and so skip the trouble of constantly sync between local folder and WebDav.

Pros:

  • No need of constant sync
  • Native supported with no need of 3rd party software solutions
  • If you use JetBrains IDE such as InteliJ IDEA or WebStorm, you can configure automatic deployment to mounted drive.

Cons:

  • If you have files outside cartridge directory, such as node_modules, grunt, building tools and etc that generates files in /cartridges/ folder, you will need to symlink /cartrdiges directory to your mounted WebDav folder

One thought on “4 ways to sync your code with the sandbox

  • Nhàn

    Is there a way to upload large backup to the sandbox, I would upload Static catalog from Staging to a sandbox for develop, but seem not possible.

Leave a Reply

Your email address will not be published. Required fields are marked *