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:
parent
77affc495f
commit
c6b251f5d5
@ -48,7 +48,7 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
host = mkOption {
|
listenAddress = mkOption {
|
||||||
default = "0.0.0.0";
|
default = "0.0.0.0";
|
||||||
example = "localhost";
|
example = "localhost";
|
||||||
type = types.str;
|
type = types.str;
|
||||||
@ -156,18 +156,18 @@ in {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
script = ''
|
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} \
|
--httpPort=${toString cfg.port} \
|
||||||
--prefix=${cfg.prefix} \
|
--prefix=${cfg.prefix} \
|
||||||
${concatStringsSep " " cfg.extraOptions}
|
${concatStringsSep " " cfg.extraOptions}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postStart = ''
|
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
|
sleep 10
|
||||||
done
|
done
|
||||||
while true ; do
|
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' ||
|
if [[ !("$index" =~ 'Please wait while Jenkins is restarting' ||
|
||||||
"$index" =~ 'Please wait while Jenkins is getting ready to work') ]]; then
|
"$index" =~ 'Please wait while Jenkins is getting ready to work') ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -144,7 +144,7 @@ in {
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo "Asking Jenkins to reload config"
|
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 = {
|
serviceConfig = {
|
||||||
User = jenkinsCfg.user;
|
User = jenkinsCfg.user;
|
||||||
|
Loading…
Reference in New Issue
Block a user