mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 01:13:05 +00:00
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
This commit is contained in:
parent
c289413caa
commit
838a2b54ed
@ -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 ''
|
||||
|
Loading…
Reference in New Issue
Block a user