diff options
author | Tom Siewert <tom@siewert.io> | 2023-12-15 17:57:24 +0100 |
---|---|---|
committer | Yaya <github@uwu.is> | 2024-01-08 18:14:06 +0100 |
commit | 838a2b54ed2dc4029b4941f2ddc14f8cb61a9877 (patch) | |
tree | 6bb0a93f42ae8eb18114dce1f406d4751ea33526 /nixos/modules/services/misc/gitlab.nix | |
parent | c289413caa1848cfb651b460d477074c191a5b22 (diff) |
nixos/gitlab: Add CI database connection for >=15.9
Starting with GitLab 15.9, single connections were deprecated [1] and will be removed in GitLab 17.0. [1] https://docs.gitlab.com/ee/update/deprecations.html#single-database-connection-is-deprecated
Diffstat (limited to 'nixos/modules/services/misc/gitlab.nix')
-rw-r--r-- | nixos/modules/services/misc/gitlab.nix | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix index 6756d59cf367c..ca6910b795d8f 100644 --- a/nixos/modules/services/misc/gitlab.nix +++ b/nixos/modules/services/misc/gitlab.nix @@ -27,7 +27,13 @@ let encoding = "utf8"; pool = cfg.databasePool; } // cfg.extraDatabaseConfig; - in if lib.versionAtLeast (lib.getVersion cfg.packages.gitlab) "15.0" then { + in if lib.versionAtLeast (lib.getVersion cfg.packages.gitlab) "15.9" then { + production.main = val; + # Starting with GitLab 15.9, single connections were deprecated and will be + # removed in GitLab 17.0. The CI connection however requires database_tasks set + # to false. + production.ci = val // { database_tasks = false; }; + } else if lib.versionAtLeast (lib.getVersion cfg.packages.gitlab) "15.0" then { production.main = val; } else { production = val; @@ -1348,7 +1354,7 @@ in { fi jq <${pkgs.writeText "database.yml" (builtins.toJSON databaseConfig)} \ - '.${if lib.versionAtLeast (lib.getVersion cfg.packages.gitlab) "15.0" then "production.main" else "production"}.password = $ENV.db_password' \ + '.${if lib.versionAtLeast (lib.getVersion cfg.packages.gitlab) "15.0" then "production.main" else "production"}.password = $ENV.db_password ${if lib.versionAtLeast (lib.getVersion cfg.packages.gitlab) "15.9" then "| .production.ci.password = $ENV.db_password | .production.main as $main | del(.production.main) | .production |= {main: $main} + ." else ""}' \ >'${cfg.statePath}/config/database.yml' '' else '' |