github garden-io/garden 0.12.35

latest releases: edge-bonsai, 0.13.33, 0.13.32...
2 years ago

Garden 0.12.35 is out! 🎉

This release includes a big new feature: Custom commands! We've also added built-in support for Kustomize for the kubernetes module type. See the sections below for more details.

We've also updated the version of Mutagen we use to power dev mode, which should result in improved stability for long-running sync sessions.

Finally, we've substantially improved startup time for the Garden CLI.

Many thanks to @ohookins, @highb and @wojciechka for their contributions to this release.

Happy hacking!

Custom Commands

As part of a Garden project, you can now define custom commands. You can think of these like Makefile targets, npm package scripts etc., except you have the full power of Garden's templating syntax to work with, and can easily declare the exact arguments and options the command accepts. The custom commands come up when you run garden help, which helps make your project easier to use and more self-documenting.

You'll find more examples and details in the custom commands guide, but here's a simple example to illustrate the idea:

kind: Command
name: api-dev
description:
  short: Start garden with preconfigured options for API development
exec:
  command:
    - sh
    - -c
    - git submodule update --recursive --remote  # Because we keep forgetting to update these, amirite?
gardenCommand:
  - deploy
  - --dev
  - api,worker
  - --log-level
  - debug
  - $concat: ${args.$all}  # Allow any arguments/options on top of the fixed ones above

Here we imagine a basic day-to-day workflow for a certain group of developers. The user simply runs garden api-dev. Before the Garden command starts, we update the submodules in the repo, and then we start garden deploy with some parameters that we tend to use or prefer.

Of course this is just an example, but no doubt you can imagine some commands, parameters etc. that you use a lot and which would be nice to codify for you and your team. And this example only uses a fraction of what's possible!

Kustomize support

The kubernetes module type now has built-in support for Kustomize, via the new kustomize config field.

Kustomize is useful when you want to add dynamism to your Kubernetes manifests without using Helm templates.

When the kustomize config field is used, Garden will call kustomize build to render the service's manifests before deploying.

Here's a usage example from the newly added Kustomize example project:

kind: Module
type: kubernetes
name: hello-world
kustomize:
  # This is actually the default (running `kustomize build` in the module root), just setting it explicitly for clarity.
  path: .
  extraArgs:
    # Note: Not actually using this here, just setting as an example
    - --enable-alpha-plugins

See reference docs for the kubernets module type for more details.

Debug logfiles

The Garden CLI now creates logfiles at the debug log level in the project-level .garden directory (under .garden/logs).

The names of these logfiles include the command name, log level and the time the command was executed (as an ISO timestamp).

Logfiles older than 7 days are also automatically cleaned up when the CLI is called.

These logfiles can be useful for getting at more detailed logs for recently-run commands that were run at a less verbose log level.

We're also planning to make these command logs easier to browse and view by adding a dedicated CLI command for viewing logs for past sessions at a specified log level. Stay tuned!

Changelog

Features

  • cli: custom commands (4e7c741a)
  • core: debug logfiles (ebff37a7)
  • core: --with-dependants option for build cmd (c3fbbbe6)
  • k8s: support kustomize on kubernetes modules (e954f72c)
  • template: add join helper function, to convert an array to string (3c02abb6)

Improvements

  • cloud: handle AEC for Helm services (3326c3c5)
  • core: evaluate null|false as undefined for dockerfile field (4f43eb6b)
  • core: better workflow error logging (0415fb7b)
  • examples: update ingress specs in example garden projects (423da252)

Performance Improvements

  • core: faster hashing and test speed improvements (7f6a7600)

Bug Fixes

  • updated brew command in dependency install script (5847f09b)
  • cli: potential OOM error for large projects (0ecd7410)
  • core: ignore trailing slashes in project config domains (7cfa4fb0)
  • k8s: handle specific error case in log streaming (5dd1c34e)
  • k8s: use namespace from module when port forwarding (c99f8e92)
  • k8s: use correct Mutagen termination command (c644ef49)
  • template: allow missing keys in AND (&&) conditionals (7bf19540)
  • template: don't fail validation on partially resolved helper calls (f03579e7)

Don't miss a new garden release

NewReleases is sending notifications on new releases.