Search…
File sync and hot reload
Sync local code changes with a running remote container
In many cases, developers prefer to run a full environment in a remote cluster, and then continuously synchronize local code changes with a running remote container.
Velocity supports this workflow using the env sync command which monitors a local folder on your computer, identifies when files get changed, and automatically synchronizes them with your running remote container.
Velocity supports two types of Code Synchronization:
  • Image rebuild (Container restart) - For use with compiled languages (such as .Net, Golang or Rust). Velocity will detect the code changes, trigger an image rebuild, and update and restart the remote running service, making your application reflect the changes.
  • Live Update (Hot reload) - For use with scripted languages (such as Python). Velocity will push updated files to the remote service, making your application refresh and reflect the changes instantly
The env sync command can get input directly from the command line, or for a better user experience, from a .velocity.yaml - that can be placed in your git repository.
Please note that this feature is currently only available upon request. Please contact Velocity support to enable this feature.
Please note that using this feature requires rsync to be installed on your local machine and on the service image.

Synchronizing changes using Image rebuild

In this mode, once the env sync command starts, Velocity monitors you local folder and detects file changes. With every detected file change, Velocity will run the following actions:
  1. 1.
    Trigger an image rebuild
  2. 2.
    Publish the image to a container registry hosted in your cloud account
  3. 3.
    Push the image to the cluster and restart the container
  4. 4.
    Sync the logs back to the command line output, to allow you to identify problems that might have occurred when building and deploying the new image.

Synchronizing changes using Live update (Hot Reload)

In this mode, once the env sync command starts, Velocity monitors you local folder and detects file changes. Your local folder will be mapped with a single folder in the running container, and with every detected file change, Velocity will uses rsync to copy the changed files from your local folder into the target folder in the container.

Env Sync Arguments

For a detailed description of all the command arguments see: CLI Reference/ env sync.