archied update install verifies the release zip, checks every binary reports the release, pulls the agent image by digest, backs up the database in-process and stages the binaries before handing off to archied update watchdog in its own process. The watchdog restarts units in release order, requires archied healthy for 120s and otherwise rolls back binaries and image policy, restoring the database only when a migration ran. Boot recovery resumes the frozen watchdog. Deletes scripts/archie-update-install, scripts/archie-update-watchdog, the updater's --from-source and --auto, CommandInstaller, ScriptInstaller and the update-image and update-topology subcommands.
34 lines
1.0 KiB
Go
34 lines
1.0 KiB
Go
// Command archied is the archie orchestrator daemon
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/samcharles93/archie-core/internal/app/archied"
|
|
"github.com/samcharles93/archie-core/internal/app/archieplaybooks"
|
|
"github.com/samcharles93/archie-core/internal/app/prbench"
|
|
)
|
|
|
|
func main() {
|
|
args := os.Args[1:]
|
|
// The setup generator is dispatched before the daemon's flags are
|
|
// parsed: it writes a first-run config.toml and must not touch the
|
|
// store, NATS, or the running daemon's configuration.
|
|
if archied.IsSetupArgs(args) {
|
|
os.Exit(archied.RunSetup(args[1:], os.Stdin, os.Stdout, os.Stderr))
|
|
}
|
|
if len(args) > 0 && args[0] == "update" {
|
|
os.Exit(archied.RunUpdate(args[1:], os.Stdout, os.Stderr))
|
|
}
|
|
if len(args) > 0 && args[0] == "status" {
|
|
os.Exit(archied.RunStatus(args[1:], os.Stdout, os.Stderr))
|
|
}
|
|
if len(args) > 0 && args[0] == "prbench" {
|
|
os.Exit(prbench.Main(args[1:], os.Stdout, os.Stderr))
|
|
}
|
|
if len(args) > 0 && args[0] == "playbooks" {
|
|
os.Exit(archieplaybooks.Run(args[1:], os.Stderr))
|
|
}
|
|
os.Exit(archied.Run())
|
|
}
|