diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2017-05-24 18:57:17 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2017-05-24 18:57:23 +0300 |
commit | 85ea46e3b26ce572d27fb4fbaea57ab06a7a845d (patch) | |
tree | 0a2c53c69780cfec2058200e27400a4fc09d8f19 /modules/apps | |
parent | 1876304b196aa49c08b7be90e6880cd829427786 (diff) | |
download | nixsap-85ea46e3b26ce572d27fb4fbaea57ab06a7a845d.tar.gz |
Jenkins: allow spaces in job name
Diffstat (limited to 'modules/apps')
-rw-r--r-- | modules/apps/jenkins/default.nix | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/apps/jenkins/default.nix b/modules/apps/jenkins/default.nix index 88107e0..c35b851 100644 --- a/modules/apps/jenkins/default.nix +++ b/modules/apps/jenkins/default.nix @@ -3,7 +3,7 @@ let inherit (builtins) - attrNames isBool isString ; + attrNames isBool isString replaceStrings ; inherit (lib) concatMapStringsSep concatStringsSep escape filterAttrs foldAttrs foldl @@ -18,7 +18,10 @@ let instances = explicit config.nixsap.apps.jenkins; users = mapAttrsToList (_: i: i.user) instances; - maybeFile = n: c: if hasPrefix "/" c then c else pkgs.writeXML n c; + maybeFile = name: cnt: + let norm = replaceStrings [" "] ["-"] name; + in if hasPrefix "/" cnt then cnt else pkgs.writeXML norm cnt; + configFiles = name: cfg: mapAttrs (n: v: maybeFile "jenkins-${name}-${n}" v) cfg.config; jobFiles = name: cfg: mapAttrs (n: v: maybeFile "jenkins-${name}-job-${n}.xml" v) cfg.jobs; |