Skip to content

Instantly share code, notes, and snippets.

@thsig
thsig / release-notes.md
Last active May 23, 2023 12:26
Draft release notes for Bonsai

Garden Bonsai (0.13) has been released!

This is a big new release, and we've been hard at work on it for several months. The main pieces are:

  • Actions. Backwards-comatible with modules, these are a simpler and more flexible way to describe your dev workflows.
  • An improved CLI experience. This includes a reimagined interactive dev command.
  • Start/stop code syncing without redeploying. The sync start & sync stop commands give you finer-grained control over code syncing.
  • Re-run tests and scripts without rebuilding. The inner loop of development just got even faster.

Below, we dive into these in a more detail.

@thsig
thsig / frontend-garden.yml
Last active April 9, 2019 15:08
Rails example - config for frontend service
kind: Module
type: container
name: frontend
description: Front-end Rails service
...
@thsig
thsig / project-config.yml
Created April 8, 2019 12:13
Rails example - project config
kind: Project
name: vote-rails
environments:
- name: local
providers:
- name: local-kubernetes
@thsig
thsig / db-migrate.txt
Created April 5, 2019 14:50
Rails example - running rake db:migrate inside a container
$ garden run task db-migrate
Running task db-migrate 🏃
✔ frontend → Getting build status... → Done (took 0.6 sec)
✔ postgres → Getting build status... → Done (took 0.6 sec)
✔ postgres → Checking status... → Version v-4bf9f73668 already deployed
✔ db-migrate → Running → Done (took 4.2 sec)
(0.5ms) SELECT pg_try_advisory_lock(737815420147457505)
↳ /usr/local/bundle/bin/rake:23
@thsig
thsig / rails-console.txt
Created April 5, 2019 14:45
Rails example - running rails console inside the container
$ garden run module frontend "rails console"
Running command rails console in module frontend 🏃
✔ frontend → Getting build status... → Done (took 0.4 sec)
Loading development environment (Rails 5.2.2.1)
irb(main):001:0> Vote.where(animal: "cat").count
(0.7ms) SELECT COUNT(*) FROM "votes" WHERE "votes"."animal" = $1 [["animal", "cat"]]
=> 6
@thsig
thsig / postgres-config.yml
Created April 5, 2019 14:43
Rails example - garden.yml for postgres service
kind: Module
description: Postgres container for storing voting results
type: container
name: postgres
image: postgres:9.4
Services:
- name: postgres
volumes: # A persistent volume for the data.
- name: data
containerPath: /db-data
@thsig
thsig / frontend-tasks.yml
Created April 5, 2019 14:42
Rails example - task config for frontend
tasks:
- name: db-migrate
args: [rake db:migrate]
dependencies:
- postgres
@thsig
thsig / frontend-service-config.yml
Created April 5, 2019 14:40
Rails example - service config for frontend
services:
- name: frontend
ports:
- name: http # Maps 80 to 3000.
containerPort: 3000
ingresses:
- path: /
port: http
hostname: vote-rails.local.app.garden
dependencies:
@thsig
thsig / frontend-hot-reload.yml
Created April 5, 2019 14:38
Rails example - hot reload config for frontend service
hotReload:
sync:
- source: app/
target: /usr/src/app/app
@thsig
thsig / garden-dev.txt
Last active April 5, 2019 14:35
Rails example - garden dev log output
$ garden dev --hot=frontend
Good morning! Let's get your environment wired up...
✔ local-kubernetes → Configured
✔ tiller → Installing to garden-system... → Done (took 5.9 sec)
ℹ tiller → Service deployed
ℹ tiller → Service deployed
✔ kubernetes-dashboard → Building version v-4f7ba3eeaf... → Done (took 1.5 sec)
✔ ingress-controller → Building version v-df47c0150b... → Done (took 1.5 sec)