feat(django-apps): Add automatic backup
Some checks failed
Check meta / check_dns (pull_request) Successful in 19s
Check meta / check_meta (pull_request) Successful in 25s
Check workflows / check_workflows (pull_request) Successful in 25s
Run pre-commit on all files / pre-commit (push) Successful in 42s
Build all the nodes / ap01 (pull_request) Successful in 1m10s
Build all the nodes / bridge01 (pull_request) Successful in 1m49s
Build all the nodes / geo02 (pull_request) Successful in 2m0s
Build all the nodes / hypervisor01 (pull_request) Successful in 1m57s
Build all the nodes / geo01 (pull_request) Successful in 2m8s
Build all the nodes / hypervisor02 (pull_request) Successful in 1m48s
Build all the nodes / netcore02 (pull_request) Successful in 33s
Build all the nodes / compute01 (pull_request) Successful in 2m49s
Build all the nodes / hypervisor03 (pull_request) Successful in 1m34s
Build all the nodes / rescue01 (pull_request) Successful in 2m11s
Build all the nodes / storage01 (pull_request) Successful in 2m15s
Build all the nodes / web02 (pull_request) Successful in 1m50s
Build all the nodes / vault01 (pull_request) Successful in 2m5s
Build all the nodes / web03 (pull_request) Failing after 1m40s
Run pre-commit on all files / pre-commit (pull_request) Successful in 34s
Build all the nodes / web01 (pull_request) Successful in 2m54s
Some checks failed
Check meta / check_dns (pull_request) Successful in 19s
Check meta / check_meta (pull_request) Successful in 25s
Check workflows / check_workflows (pull_request) Successful in 25s
Run pre-commit on all files / pre-commit (push) Successful in 42s
Build all the nodes / ap01 (pull_request) Successful in 1m10s
Build all the nodes / bridge01 (pull_request) Successful in 1m49s
Build all the nodes / geo02 (pull_request) Successful in 2m0s
Build all the nodes / hypervisor01 (pull_request) Successful in 1m57s
Build all the nodes / geo01 (pull_request) Successful in 2m8s
Build all the nodes / hypervisor02 (pull_request) Successful in 1m48s
Build all the nodes / netcore02 (pull_request) Successful in 33s
Build all the nodes / compute01 (pull_request) Successful in 2m49s
Build all the nodes / hypervisor03 (pull_request) Successful in 1m34s
Build all the nodes / rescue01 (pull_request) Successful in 2m11s
Build all the nodes / storage01 (pull_request) Successful in 2m15s
Build all the nodes / web02 (pull_request) Successful in 1m50s
Build all the nodes / vault01 (pull_request) Successful in 2m5s
Build all the nodes / web03 (pull_request) Failing after 1m40s
Run pre-commit on all files / pre-commit (pull_request) Successful in 34s
Build all the nodes / web01 (pull_request) Successful in 2m54s
This commit is contained in:
parent
3085d9e3a8
commit
b6272ce2ec
2 changed files with 18 additions and 2 deletions
|
@ -11,7 +11,12 @@
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkEnableOption mkOption remove;
|
inherit (lib)
|
||||||
|
getExe'
|
||||||
|
mkEnableOption
|
||||||
|
mkOption
|
||||||
|
remove
|
||||||
|
;
|
||||||
|
|
||||||
inherit (lib.types)
|
inherit (lib.types)
|
||||||
attrs
|
attrs
|
||||||
|
@ -93,7 +98,7 @@ in
|
||||||
"${db}-db".settings = {
|
"${db}-db".settings = {
|
||||||
user = "postgres";
|
user = "postgres";
|
||||||
command = [
|
command = [
|
||||||
"${lib.getExe' config.services.postgresql.package "pg_dump"}"
|
(getExe' config.services.postgresql.package "pg_dump")
|
||||||
db
|
db
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -113,6 +118,8 @@ in
|
||||||
"storage01"
|
"storage01"
|
||||||
"vault01"
|
"vault01"
|
||||||
"web01"
|
"web01"
|
||||||
|
"web02"
|
||||||
|
"web03"
|
||||||
];
|
];
|
||||||
allowed = [ "put" ];
|
allowed = [ "put" ];
|
||||||
}
|
}
|
||||||
|
|
|
@ -732,5 +732,14 @@ in
|
||||||
) config.extraServices)
|
) config.extraServices)
|
||||||
) cfg.sites);
|
) cfg.sites);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dgn-backups = {
|
||||||
|
jobs = mapAttrs' (
|
||||||
|
name: _: nameValuePair "dj-${name}" { settings.paths = [ "/var/lib/django-apps/${name}" ]; }
|
||||||
|
) cfg.sites;
|
||||||
|
postgresDatabases = builtins.map (name: "dj-${name}") (
|
||||||
|
attrNames (filterAttrs (_: { dbType, ... }: dbType == "postgresql") cfg.sites)
|
||||||
|
);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue