mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 15:22:59 +01:00
nixos/gitlab-runner: reload on config change
With this change it is no longer required to restart the runner on every change. Instead it can just reload it's config while running.
This commit is contained in:
parent
328f8112cc
commit
848af2c6fc
1 changed files with 10 additions and 1 deletions
|
@ -120,10 +120,16 @@ in
|
||||||
++ optional hasDocker "docker.service";
|
++ optional hasDocker "docker.service";
|
||||||
requires = optional hasDocker "docker.service";
|
requires = optional hasDocker "docker.service";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
reloadIfChanged = true;
|
||||||
|
restartTriggers = [
|
||||||
|
config.environment.etc."gitlab-runner/config.toml".source
|
||||||
|
];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
StateDirectory = "gitlab-runner";
|
||||||
|
ExecReload= "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||||
ExecStart = ''${cfg.package.bin}/bin/gitlab-runner run \
|
ExecStart = ''${cfg.package.bin}/bin/gitlab-runner run \
|
||||||
--working-directory ${cfg.workDir} \
|
--working-directory ${cfg.workDir} \
|
||||||
--config ${configFile} \
|
--config /etc/gitlab-runner/config.toml \
|
||||||
--service gitlab-runner \
|
--service gitlab-runner \
|
||||||
--user gitlab-runner \
|
--user gitlab-runner \
|
||||||
'';
|
'';
|
||||||
|
@ -138,6 +144,9 @@ in
|
||||||
# Make the gitlab-runner command availabe so users can query the runner
|
# Make the gitlab-runner command availabe so users can query the runner
|
||||||
environment.systemPackages = [ cfg.package ];
|
environment.systemPackages = [ cfg.package ];
|
||||||
|
|
||||||
|
# Make sure the config can be reloaded on change
|
||||||
|
environment.etc."gitlab-runner/config.toml".source = configFile;
|
||||||
|
|
||||||
users.users.gitlab-runner = {
|
users.users.gitlab-runner = {
|
||||||
group = "gitlab-runner";
|
group = "gitlab-runner";
|
||||||
extraGroups = optional hasDocker "docker";
|
extraGroups = optional hasDocker "docker";
|
||||||
|
|
Loading…
Reference in a new issue