mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-15 13:37:21 +03:00
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";
|
||||
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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user