mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 08:23:09 +00:00
[Backport release-24.11] nixos/netbox: clear old static files on upgrade (#358101)
This commit is contained in:
commit
7ede593364
@ -298,13 +298,13 @@ in {
|
||||
# This mostly correspond to upstream NetBox's 'upgrade.sh' script.
|
||||
versionFile="${cfg.dataDir}/version"
|
||||
|
||||
if [[ -e "$versionFile" && "$(cat "$versionFile")" == "${cfg.package.version}" ]]; then
|
||||
if [[ -h "$versionFile" && "$(readlink -- "$versionFile")" == "${cfg.package}" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
${pkg}/bin/netbox migrate
|
||||
${pkg}/bin/netbox trace_paths --no-input
|
||||
${pkg}/bin/netbox collectstatic --no-input
|
||||
${pkg}/bin/netbox collectstatic --clear --no-input
|
||||
${pkg}/bin/netbox remove_stale_contenttypes --no-input
|
||||
${pkg}/bin/netbox reindex --lazy
|
||||
${pkg}/bin/netbox clearsessions
|
||||
@ -314,7 +314,7 @@ in {
|
||||
(lib.versionOlder cfg.package.version "3.7.0")
|
||||
"${pkg}/bin/netbox clearcache"}
|
||||
|
||||
echo "${cfg.package.version}" > "$versionFile"
|
||||
ln -sfn "${cfg.package}" "$versionFile"
|
||||
'';
|
||||
|
||||
serviceConfig = defaultServiceConfig // {
|
||||
|
Loading…
Reference in New Issue
Block a user