From f652a0836a3714e29f7349ec247a2cd567b1357f Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Wed, 6 Aug 2008 15:07:29 +0000 Subject: [PATCH] Added support for custom context.xml svn path=/nixos/trunk/; revision=12513 --- system/options.nix | 9 +++++++-- upstart-jobs/tomcat.nix | 9 +++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/system/options.nix b/system/options.nix index 551d4f5d3a2a..5fd90329e2b2 100644 --- a/system/options.nix +++ b/system/options.nix @@ -1467,12 +1467,17 @@ sharedLibFrom = mkOption { default = ""; - description ="Location where shared libraries are stored. Leave empty to use the baseDir."; + description = "Location where shared libraries are stored. Leave empty to use the baseDir."; }; commonLibFrom = mkOption { default = ""; - description ="Location where common libraries are stored. Leave empty to use the baseDir."; + description = "Location where common libraries are stored. Leave empty to use the baseDir."; + }; + + contextXML = mkOption { + default = ""; + description = "Location of the context.xml to use. Leave empty to use the default."; }; }; diff --git a/upstart-jobs/tomcat.nix b/upstart-jobs/tomcat.nix index 6ad47607c215..503d1cf3963c 100644 --- a/upstart-jobs/tomcat.nix +++ b/upstart-jobs/tomcat.nix @@ -38,6 +38,15 @@ in cp -av ${pkgs.tomcat6}/{conf,temp,logs} ${cfg.baseDir} fi + # Deploy context.xml + + if test "${cfg.contextXML}" = "" + then + cp ${pkgs.tomcat6}/conf/context.xml.default ${cfg.baseDir}/conf/context.xml + else + cp ${cfg.contextXML} ${cfg.baseDir}/conf/context.xml + fi + # Deploy all webapplications if ! test "${cfg.deployFrom}" = ""