nixos/jenkins: rename option 'host' to 'listenAddress'

I think the name 'listenAddress' is more descriptive. Other NixOS
modules that define 'host' either use it as listen address or as address
a client connects to. listenAddress is unambiguous.

The addition of 'host' was added earlier today[1], so not bothering with
./nixos/modules/rename.nix.

[1]: 44ea184997 ("jenkins ci enhancement: add port and prefix option")
This commit is contained in:
Bjørn Forsman 2015-12-23 23:17:03 +01:00
parent 77affc495f
commit c6b251f5d5
2 changed files with 5 additions and 5 deletions

View file

@ -48,7 +48,7 @@ in {
'';
};
host = mkOption {
listenAddress = mkOption {
default = "0.0.0.0";
example = "localhost";
type = types.str;
@ -156,18 +156,18 @@ in {
'';
script = ''
${pkgs.jdk}/bin/java -jar ${pkgs.jenkins} --httpListenAddress=${cfg.host} \
${pkgs.jdk}/bin/java -jar ${pkgs.jenkins} --httpListenAddress=${cfg.listenAddress} \
--httpPort=${toString cfg.port} \
--prefix=${cfg.prefix} \
${concatStringsSep " " cfg.extraOptions}
'';
postStart = ''
until ${pkgs.curl}/bin/curl -s -L ${cfg.host}:${toString cfg.port}${cfg.prefix} ; do
until ${pkgs.curl}/bin/curl -s -L ${cfg.listenAddress}:${toString cfg.port}${cfg.prefix} ; do
sleep 10
done
while true ; do
index=`${pkgs.curl}/bin/curl -s -L ${cfg.host}:${toString cfg.port}${cfg.prefix}`
index=`${pkgs.curl}/bin/curl -s -L ${cfg.listenAddress}:${toString cfg.port}${cfg.prefix}`
if [[ !("$index" =~ 'Please wait while Jenkins is restarting' ||
"$index" =~ 'Please wait while Jenkins is getting ready to work') ]]; then
exit 0

View file

@ -144,7 +144,7 @@ in {
done
echo "Asking Jenkins to reload config"
curl --silent -X POST http://${jenkinsCfg.host}:${toString jenkinsCfg.port}${jenkinsCfg.prefix}/reload
curl --silent -X POST http://${jenkinsCfg.listenAddress}:${toString jenkinsCfg.port}${jenkinsCfg.prefix}/reload
'';
serviceConfig = {
User = jenkinsCfg.user;