69 lines
2.1 KiB
Text
69 lines
2.1 KiB
Text
|
|
let w = import "../../../schemas/lib/workflow.ncl" in
|
||
|
|
|
||
|
|
{
|
||
|
|
upgrade_services | w.WorkflowDef = {
|
||
|
|
id = "upgrade-services",
|
||
|
|
description = "Upgrade L3 services preserving data and connectivity",
|
||
|
|
|
||
|
|
steps = [
|
||
|
|
{
|
||
|
|
id = "backup-pg",
|
||
|
|
targets = [{ component = "postgresql", operation = "backup" }],
|
||
|
|
on_error = 'Stop,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
id = "upgrade-pg",
|
||
|
|
targets = [{ component = "postgresql", operation = "update" }],
|
||
|
|
depends_on = ["backup-pg"],
|
||
|
|
on_error = 'Rollback,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
id = "upgrade-forgejo",
|
||
|
|
targets = [{ component = "forgejo", operation = "update" }],
|
||
|
|
depends_on = ["upgrade-pg"],
|
||
|
|
on_error = 'Rollback,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
id = "upgrade-woodpecker",
|
||
|
|
targets = [{ component = "woodpecker", operation = "update" }],
|
||
|
|
depends_on = ["upgrade-pg", "upgrade-forgejo"],
|
||
|
|
on_error = 'Rollback,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
id = "upgrade-zot",
|
||
|
|
targets = [{ component = "zot", operation = "update" }],
|
||
|
|
on_error = 'Rollback,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
id = "validate",
|
||
|
|
targets = [
|
||
|
|
{ component = "postgresql", operation = "health" },
|
||
|
|
{ component = "forgejo", operation = "health" },
|
||
|
|
{ component = "woodpecker", operation = "health" },
|
||
|
|
{ component = "zot", operation = "health" },
|
||
|
|
],
|
||
|
|
depends_on = ["upgrade-forgejo", "upgrade-woodpecker", "upgrade-zot"],
|
||
|
|
on_error = 'Continue,
|
||
|
|
},
|
||
|
|
],
|
||
|
|
|
||
|
|
rollback = [
|
||
|
|
{
|
||
|
|
id = "restore-pg",
|
||
|
|
targets = [{ component = "postgresql", operation = "restore" }],
|
||
|
|
on_error = 'Continue,
|
||
|
|
},
|
||
|
|
],
|
||
|
|
},
|
||
|
|
|
||
|
|
metadata | w.WorkflowMetadata = {
|
||
|
|
id = "upgrade-services",
|
||
|
|
name = "Upgrade Management Services",
|
||
|
|
description = "Rolling upgrade with backup, health gates, and automatic rollback on failure",
|
||
|
|
tags = ["upgrade", "services", "L3"],
|
||
|
|
actors = ['Developer],
|
||
|
|
requires_approval = true,
|
||
|
|
triggers = { manual = true },
|
||
|
|
},
|
||
|
|
}
|