Release Announcement: Garden 0.12.21

Garden 0.12.21 is out! :tada:

Along with a few bugfixes and minor improvements, this release includes a major new feature: Dev Mode.

See the changelog in the release notes for a full list of changes.

Finally, many thanks to @tvollstaedt and @matthew-muscat for their contributions to their release!

Dev Mode (experimental)

Dev mode works similarly to hot reloading, but is much faster and more reliable. In addition, it works a lot better on Windows than the old rsync-based hot reload implementation.

It also supports bidirectional syncing, which enables you to sync new/changed files from your containers to your local machine.

This new sync mode uses Mutagen under the hood. Garden automatically takes care of fetching Mutagen, so you donโ€™t need to install any dependencies yourself to make use of dev mode.

Dev mode sync is not affected by includes/excludes, which makes it more flexible than hot reloading. For example, you can use it to sync your build/dist directory into your container while running local, incremental builds (without having to remove those directories from your ignorefiles).

Eventually, the plan is to deprecate hot reloading in favor of dev mode. Dev mode is currently flagged as experimental, but is well-tested and already being used in the wild. Please let us know what you think, and report any bugs or suggestions that come up!

Dev mode is currently supported for container, kubernetes and helm modules.

To configure a service for dev mode, add devMode to your module/service configuration:

kind: Module
name: my-service
type: container
services:
  - name: my-service
    args: [npm, start]
    devMode:
      command: [npm, run, dev] # Overrides the container's default when the service is deployed in dev mode
      sync:
        # Source/target configuration for dev mode is the same as for hot reloading.
        - target: /app
          type: two-way # Here, files created/modified remotely will get synced back and vice-versa
        # You can use several sync specs for the same service.
        - source: /tmp/somedir
          target: /somedir
          type: one-way # Here, only files created/modified locally will be synced (to the remote target)
  ...

Hereโ€™s a link to the new section on dev mode in the hot reload guide: Hot Reload - Garden

See the reference docs for the container, kubernetes and helm module types for detailed configuration specs.

Dev mode opens up exciting, productive new ways to set up your inner dev loop with Garden. Happy hacking!

1 Like