diff options
author | Florian Klink <flokli@flokli.de> | 2020-03-31 20:18:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-31 20:18:28 +0200 |
commit | 9faea55282d2a553b6e10fe1ee90eb5682a4a3e7 (patch) | |
tree | 03fdb4ac66fbbc789f8a35c4f2d6ccc34182cf90 | |
parent | 1b6245b4fbed6acce100a95356404313a473e3ba (diff) | |
parent | 848af2c6fc214b12a34442574755826678251181 (diff) |
Merge pull request #74379 from bachp/gitlab-runner-reload
nixos/gitlab-runner: reload on config change
-rw-r--r-- | nixos/modules/services/continuous-integration/gitlab-runner.nix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/modules/services/continuous-integration/gitlab-runner.nix b/nixos/modules/services/continuous-integration/gitlab-runner.nix index 3d307b1abcf83..bd4cf6a37bad8 100644 --- a/nixos/modules/services/continuous-integration/gitlab-runner.nix +++ b/nixos/modules/services/continuous-integration/gitlab-runner.nix @@ -120,10 +120,16 @@ in ++ optional hasDocker "docker.service"; requires = optional hasDocker "docker.service"; wantedBy = [ "multi-user.target" ]; + reloadIfChanged = true; + restartTriggers = [ + config.environment.etc."gitlab-runner/config.toml".source + ]; serviceConfig = { + StateDirectory = "gitlab-runner"; + ExecReload= "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; ExecStart = ''${cfg.package.bin}/bin/gitlab-runner run \ --working-directory ${cfg.workDir} \ - --config ${configFile} \ + --config /etc/gitlab-runner/config.toml \ --service gitlab-runner \ --user gitlab-runner \ ''; @@ -138,6 +144,9 @@ in # Make the gitlab-runner command availabe so users can query the runner 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 = { group = "gitlab-runner"; extraGroups = optional hasDocker "docker"; |