FEATURE: add runtime features (#849)
authorJeff Wong <awole20@gmail.com>
Mon, 2 Sep 2024 22:09:38 +0000 (15:09 -0700)
committerGitHub <noreply@github.com>
Mon, 2 Sep 2024 22:09:38 +0000 (06:09 +0800)
commitd87acd4ccdac97db65e5c7bef0a0f6724d4b39e3
tree8de632e3f1ba2e2ccf37b22811d27363d05295e5
parentde17bef722f472139cb461bf35a9689ebd9b4e7f
FEATURE: add runtime features (#849)

adds commands for: start, run, stop, cleanup, destroy, logs, enter, restart, rebuild -- carrying over existing run commands from launcher1.

Rebuild will also do its best to minimize downtime with the following steps:

* Detect if Discourse is running as a single container or external DB
* Detect if db:migrate is configured to run on container boot
* Build initial container (keeping existing one online)
* Exit running containers if it's a single container (otherwise keeps existing online)
* Run migrations
  * Defer migrations if db:migrate is configured to run on container boot
  * Run migrations with SKIP_POST_DEPLOYMENT_MIGRATIONS=1 if it's a 2 container setup
  * Otherwise, run all migrations
* Destroy the old container (finally stopping the current, if it's still up here)
* Start the new container
* Run post-deploy migrations
  * Run migrations with SKIP_POST_DEPLOYMENT_MIGRATIONS=0 if it's a 2 container setup
launcher_go/v2/cli_build.go
launcher_go/v2/cli_runtime.go [new file with mode: 0644]
launcher_go/v2/cli_runtime_test.go [new file with mode: 0644]
launcher_go/v2/docker/commands.go
launcher_go/v2/main.go