diff options
author | Fernando J Pando <fernando.pando@stelligent.com> | 2017-03-07 14:26:21 -0500 |
---|---|---|
committer | Fernando J Pando <fernando.pando@stelligent.com> | 2017-04-21 10:32:36 -0400 |
commit | 4ac06ea6a13bf082791f1e3293528dc6c1b67841 (patch) | |
tree | f07a4401e9a129befd6e0e3b87bbeff8fda2f01d /nixos/modules/services/continuous-integration | |
parent | 4c0098f1dc65bc664be941fb4290274eba703483 (diff) | |
download | nixlib-4ac06ea6a13bf082791f1e3293528dc6c1b67841.tar nixlib-4ac06ea6a13bf082791f1e3293528dc6c1b67841.tar.gz nixlib-4ac06ea6a13bf082791f1e3293528dc6c1b67841.tar.bz2 nixlib-4ac06ea6a13bf082791f1e3293528dc6c1b67841.tar.lz nixlib-4ac06ea6a13bf082791f1e3293528dc6c1b67841.tar.xz nixlib-4ac06ea6a13bf082791f1e3293528dc6c1b67841.tar.zst nixlib-4ac06ea6a13bf082791f1e3293528dc6c1b67841.zip |
buildbot: 0.9.4 -> 0.9.5
- adds distro dependency - buildbot nodaemon in service module - fakerepo for module tests - service module parameter fixup - tested on nixos - tested on darwin
Diffstat (limited to 'nixos/modules/services/continuous-integration')
-rw-r--r-- | nixos/modules/services/continuous-integration/buildbot/master.nix | 47 | ||||
-rw-r--r-- | nixos/modules/services/continuous-integration/buildbot/worker.nix | 11 |
2 files changed, 30 insertions, 28 deletions
diff --git a/nixos/modules/services/continuous-integration/buildbot/master.nix b/nixos/modules/services/continuous-integration/buildbot/master.nix index 533751734fa5..244aae445966 100644 --- a/nixos/modules/services/continuous-integration/buildbot/master.nix +++ b/nixos/modules/services/continuous-integration/buildbot/master.nix @@ -12,7 +12,7 @@ let factory = util.BuildFactory() c = BuildmasterConfig = dict( workers = [${concatStringsSep "," cfg.workers}], - protocols = { 'pb': {'port': ${cfg.bpPort} } }, + protocols = { 'pb': {'port': ${toString cfg.bpPort} } }, title = '${escapeStr cfg.title}', titleURL = '${escapeStr cfg.titleUrl}', buildbotURL = '${escapeStr cfg.buildbotUrl}', @@ -62,7 +62,7 @@ in { extraConfig = mkOption { type = types.str; description = "Extra configuration to append to master.cfg"; - default = ""; + default = "c['buildbotNetUsageData'] = None"; }; masterCfg = mkOption { @@ -92,10 +92,7 @@ in { workers = mkOption { type = types.listOf types.str; description = "List of Workers."; - default = [ - "worker.Worker('example-worker', 'pass')" - ]; - example = [ "worker.LocalWorker('example-worker')" ]; + default = [ "worker.Worker('example-worker', 'pass')" ]; }; status = mkOption { @@ -135,9 +132,8 @@ in { }; bpPort = mkOption { - default = "9989"; - type = types.string; - example = "tcp:10000:interface=127.0.0.1"; + default = 9989; + type = types.int; description = "Port where the master will listen to Buildbot Worker."; }; @@ -179,14 +175,14 @@ in { package = mkOption { type = types.package; - default = pkgs.buildbot-ui; - defaultText = "pkgs.buildbot-ui"; + default = pkgs.buildbot-full; + defaultText = "pkgs.buildbot-full"; description = "Package to use for buildbot."; example = literalExample "pkgs.buildbot-full"; }; packages = mkOption { - default = [ ]; + default = with pkgs; [ python27Packages.twisted git ]; example = literalExample "[ pkgs.git ]"; type = types.listOf types.package; description = "Packages to add to PATH for the buildbot process."; @@ -212,29 +208,30 @@ in { systemd.services.buildbot-master = { description = "Buildbot Continuous Integration Server."; - after = [ "network.target" ]; + after = [ "network-online.target" ]; wantedBy = [ "multi-user.target" ]; path = cfg.packages; + preStart = '' + env > envvars + mkdir -vp ${cfg.buildbotDir} + ln -sfv ${masterCfg} ${cfg.buildbotDir}/master.cfg + rm -fv $cfg.buildbotDir}/buildbot.tac + ${cfg.package}/bin/buildbot create-master ${cfg.buildbotDir} + ''; + serviceConfig = { Type = "simple"; User = cfg.user; Group = cfg.group; WorkingDirectory = cfg.home; - ExecStart = "${cfg.package}/bin/buildbot start --nodaemon ${cfg.buildbotDir}"; - }; + Environment = "PYTHONPATH=${cfg.package}/lib/python2.7/site-packages:${pkgs.buildbot-plugins.www}/lib/python2.7/site-packages:${pkgs.buildbot-plugins.waterfall-view}/lib/python2.7/site-packages:${pkgs.buildbot-plugins.console-view}/lib/python2.7/site-packages:${pkgs.python27Packages.future}/lib/python2.7/site-packages:${pkgs.python27Packages.dateutil}/lib/python2.7/site-packages:${pkgs.python27Packages.six}/lib/python2.7/site-packages:${pkgs.python27Packages.sqlalchemy}/lib/python2.7/site-packages:${pkgs.python27Packages.jinja2}/lib/python2.7/site-packages:${pkgs.python27Packages.markupsafe}/lib/python2.7/site-packages:${pkgs.python27Packages.sqlalchemy_migrate}/lib/python2.7/site-packages:${pkgs.python27Packages.tempita}/lib/python2.7/site-packages:${pkgs.python27Packages.decorator}/lib/python2.7/site-packages:${pkgs.python27Packages.sqlparse}/lib/python2.7/site-packages:${pkgs.python27Packages.txaio}/lib/python2.7/site-packages:${pkgs.python27Packages.autobahn}/lib/python2.7/site-packages:${pkgs.python27Packages.pyjwt}/lib/python2.7/site-packages:${pkgs.python27Packages.distro}/lib/python2.7/site-packages:${pkgs.python27Packages.pbr}/lib/python2.7/site-packages:${pkgs.python27Packages.urllib3}/lib/python2.7/site-packages"; - preStart = '' - ${pkgs.coreutils}/bin/mkdir -vp ${cfg.buildbotDir} - ${pkgs.coreutils}/bin/ln -sfv ${masterCfg} ${cfg.buildbotDir}/master.cfg - ${cfg.package}/bin/buildbot create-master ${cfg.buildbotDir} - ''; + # NOTE: call twistd directly with stdout logging for systemd + #ExecStart = "${cfg.package}/bin/buildbot start --nodaemon ${cfg.buildbotDir}"; + ExecStart = "${pkgs.python27Packages.twisted}/bin/twistd -n -l - -y ${cfg.buildbotDir}/buildbot.tac"; + }; - postStart = '' - until [[ $(${pkgs.curl}/bin/curl -s --head -w '\n%{http_code}' http://localhost:${toString cfg.port} | tail -n1) =~ ^(200|403)$ ]]; do - sleep 1 - done - ''; }; }; diff --git a/nixos/modules/services/continuous-integration/buildbot/worker.nix b/nixos/modules/services/continuous-integration/buildbot/worker.nix index e4ee4dd861ef..a97f571e89df 100644 --- a/nixos/modules/services/continuous-integration/buildbot/worker.nix +++ b/nixos/modules/services/continuous-integration/buildbot/worker.nix @@ -74,7 +74,7 @@ in { }; packages = mkOption { - default = [ ]; + default = with pkgs; [ python27Packages.twisted git ]; example = literalExample "[ pkgs.git ]"; type = types.listOf types.package; description = "Packages to add to PATH for the buildbot process."; @@ -106,7 +106,8 @@ in { path = cfg.packages; preStart = '' - ${pkgs.coreutils}/bin/mkdir -vp ${cfg.buildbotDir} + mkdir -vp ${cfg.buildbotDir} + rm -fv $cfg.buildbotDir}/buildbot.tac ${cfg.package}/bin/buildbot-worker create-worker ${cfg.buildbotDir} ${cfg.masterUrl} ${cfg.workerUser} ${cfg.workerPass} ''; @@ -115,7 +116,11 @@ in { User = cfg.user; Group = cfg.group; WorkingDirectory = cfg.home; - ExecStart = "${cfg.package}/bin/buildbot-worker start --nodaemon ${cfg.buildbotDir}"; + Environment = "PYTHONPATH=${cfg.package}/lib/python2.7/site-packages:${pkgs.python27Packages.future}/lib/python2.7/site-packages"; + + # NOTE: call twistd directly with stdout logging for systemd + #ExecStart = "${cfg.package}/bin/buildbot-worker start --nodaemon ${cfg.buildbotDir}"; + ExecStart = "${pkgs.python27Packages.twisted}/bin/twistd -n -l - -y ${cfg.buildbotDir}/buildbot.tac"; }; }; |