aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2017-05-24 18:57:17 +0300
committerIgor Pashev <pashev.igor@gmail.com>2017-05-24 18:57:23 +0300
commit85ea46e3b26ce572d27fb4fbaea57ab06a7a845d (patch)
tree0a2c53c69780cfec2058200e27400a4fc09d8f19
parent1876304b196aa49c08b7be90e6880cd829427786 (diff)
downloadnixsap-85ea46e3b26ce572d27fb4fbaea57ab06a7a845d.tar.gz
Jenkins: allow spaces in job name
-rw-r--r--modules/apps/jenkins/default.nix7
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;