From 85ea46e3b26ce572d27fb4fbaea57ab06a7a845d Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Wed, 24 May 2017 18:57:17 +0300 Subject: Jenkins: allow spaces in job name --- modules/apps/jenkins/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'modules/apps') 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; -- cgit v1.2.3