From 9f062c2c0b98a8f6e715dacc4b90ca712a868fac Mon Sep 17 00:00:00 2001 From: Fernando J Pando Date: Mon, 27 Feb 2017 14:02:11 -0500 Subject: [PATCH] buildbot: 0.9.3 -> 0.9.4 - adds jwt - adds module tests - master.cfg as path in module - fix systemd worker config - builds on darwin - tested on nixos --- .../buildbot/master.nix | 18 +++----- .../buildbot/worker.nix | 5 +- nixos/tests/buildbot.nix | 46 +++++++++++++++++++ .../tools/build-managers/buildbot/default.nix | 6 +-- .../tools/build-managers/buildbot/plugins.nix | 20 ++++---- .../tools/build-managers/buildbot/worker.nix | 5 +- 6 files changed, 66 insertions(+), 34 deletions(-) create mode 100644 nixos/tests/buildbot.nix diff --git a/nixos/modules/services/continuous-integration/buildbot/master.nix b/nixos/modules/services/continuous-integration/buildbot/master.nix index f638cf4bae3b..68306109130e 100644 --- a/nixos/modules/services/continuous-integration/buildbot/master.nix +++ b/nixos/modules/services/continuous-integration/buildbot/master.nix @@ -28,7 +28,7 @@ let ${cfg.extraConfig} '' - else pkgs.writeText "master.cfg" cfg.masterCfg; + else cfg.masterCfg; in { options = { @@ -66,13 +66,10 @@ in { }; masterCfg = mkOption { - type = types.nullOr types.str; - description = '' - Optionally pass raw master.cfg file as string. - Other options in this configuration will be ignored. - ''; + type = types.nullOr types.path; + description = "Optionally pass master.cfg path. Other options in this configuration will be ignored."; default = null; - example = "BuildmasterConfig = c = {}"; + example = "/etc/nixos/buildbot/master.cfg"; }; schedulers = mkOption { @@ -88,7 +85,7 @@ in { type = types.listOf types.str; description = "List of Builders."; default = [ - "util.BuilderConfig(name='runtests',workernames=['default-worker'],factory=factory)" + "util.BuilderConfig(name='runtests',workernames=['example-worker'],factory=factory)" ]; }; @@ -183,10 +180,7 @@ in { package = mkOption { type = types.package; default = pkgs.buildbot-ui; - description = '' - Package to use for buildbot. - buildbot-full is required in order to use local workers. - ''; + description = "Package to use for buildbot."; example = pkgs.buildbot-full; }; diff --git a/nixos/modules/services/continuous-integration/buildbot/worker.nix b/nixos/modules/services/continuous-integration/buildbot/worker.nix index 430fd4e53f1c..1ad1319d501d 100644 --- a/nixos/modules/services/continuous-integration/buildbot/worker.nix +++ b/nixos/modules/services/continuous-integration/buildbot/worker.nix @@ -100,14 +100,11 @@ in { systemd.services.buildbot-worker = { description = "Buildbot Worker."; - after = [ "network.target" ]; + after = [ "network.target" "buildbot-master.service" ]; wantedBy = [ "multi-user.target" ]; - wants = [ "buildbot-master.service" ]; path = cfg.packages; preStart = '' - # NOTE: ensure master has time to start in case running on localhost - ${pkgs.coreutils}/bin/sleep 4 ${pkgs.coreutils}/bin/mkdir -vp ${cfg.buildbotDir} ${cfg.package}/bin/buildbot-worker create-worker ${cfg.buildbotDir} ${cfg.masterUrl} ${cfg.workerUser} ${cfg.workerPass} ''; diff --git a/nixos/tests/buildbot.nix b/nixos/tests/buildbot.nix new file mode 100644 index 000000000000..13a162e6c6e8 --- /dev/null +++ b/nixos/tests/buildbot.nix @@ -0,0 +1,46 @@ +# Test ensures buildbot master comes up correctly and workers can connect + +import ./make-test.nix ({ pkgs, ... } : { + name = "buildbot"; + + nodes = { + bbmaster = { config, pkgs, nodes, ... }: { + services.buildbot-master = { + enable = true; + factorySteps = [ + "steps.Git(repourl='git://github.com/buildbot/pyflakes.git', mode='incremental')" + "steps.ShellCommand(command=['trial', 'pyflakes'])" + ]; + changeSource = [ + "changes.GitPoller('git://github.com/buildbot/pyflakes.git', workdir='gitpoller-workdir', branch='master', pollinterval=300)" + ]; + }; + networking.firewall.allowedTCPPorts = [ 8010 9989 ]; + }; + + bbworker = { config, pkgs, ... }: { + services.buildbot-worker = { + enable = true; + masterUrl = "bbmaster:9989"; + }; + }; + }; + + testScript = '' + + $bbmaster->waitForUnit("network.target"); + $bbworker->waitForUnit("network.target"); + + # Additional tests to be added + #$bbmaster->waitForUnit("buildbot-master.service"); + #$bbmaster->waitUntilSucceeds("curl -s --head http://bbmaster:8010") =~ /200 OK/ or die; + #$bbworker->waitForUnit("buildbot-worker.service"); + #$bbworker->waitUntilSucceeds("tail -10 /home/bbworker/worker/twistd.log") =~ /success/ or die; + + ''; + + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ nand0p ]; + }; + +}) diff --git a/pkgs/development/tools/build-managers/buildbot/default.nix b/pkgs/development/tools/build-managers/buildbot/default.nix index 427ff7058405..b9b8dc719270 100644 --- a/pkgs/development/tools/build-managers/buildbot/default.nix +++ b/pkgs/development/tools/build-managers/buildbot/default.nix @@ -4,10 +4,10 @@ pythonPackages.buildPythonApplication (rec { name = "${pname}-${version}"; pname = "buildbot"; - version = "0.9.3"; + version = "0.9.4"; src = fetchurl { url = "mirror://pypi/b/${pname}/${name}.tar.gz"; - sha256 = "1yw7knk5dcvwms14vqwlp89flhjf8567l17s9cq7vydh760nmg62"; + sha256 = "0wklrn4fszac9wi8zw3vbsznwyff6y57cz0i81zvh46skb6n3086"; }; buildInputs = with pythonPackages; [ @@ -41,6 +41,7 @@ pythonPackages.buildPythonApplication (rec { dateutil txaio autobahn + pyjwt # tls pyopenssl @@ -70,7 +71,6 @@ pythonPackages.buildPythonApplication (rec { homepage = http://buildbot.net/; description = "Continuous integration system that automates the build/test cycle"; maintainers = with maintainers; [ nand0p ryansydnor ]; - platforms = platforms.linux; license = licenses.gpl2; }; }) diff --git a/pkgs/development/tools/build-managers/buildbot/plugins.nix b/pkgs/development/tools/build-managers/buildbot/plugins.nix index f2fdd1535bfd..b22759af8fec 100644 --- a/pkgs/development/tools/build-managers/buildbot/plugins.nix +++ b/pkgs/development/tools/build-managers/buildbot/plugins.nix @@ -4,11 +4,11 @@ let buildbot-pkg = pythonPackages.buildPythonPackage rec { name = "${pname}-${version}"; pname = "buildbot-pkg"; - version = "0.9.3"; + version = "0.9.4"; src = fetchurl { url = "mirror://pypi/b/${pname}/${name}.tar.gz"; - sha256 = "02949cvmghyh313i1hmplwxp3nzq789kk85xjx2ir82cpr1d6h6j"; + sha256 = "09a3yvs5hhf8syrkyydznmymgg86dpvgrwy9rb3bryq00wpjb3wn"; }; propagatedBuildInputs = with pythonPackages; [ setuptools ]; @@ -17,7 +17,6 @@ let homepage = http://buildbot.net/; description = "Buildbot Packaging Helper"; maintainers = with maintainers; [ nand0p ryansydnor ]; - platforms = platforms.all; license = licenses.gpl2; }; }; @@ -26,7 +25,7 @@ in { www = pythonPackages.buildPythonPackage rec { name = "${pname}-${version}"; pname = "buildbot_www"; - version = "0.9.3"; + version = "0.9.4"; # NOTE: wheel is used due to buildbot circular dependency format = "wheel"; @@ -34,14 +33,13 @@ in { src = pythonPackages.fetchPypi { inherit pname version format; python = "py2"; - sha256 = "0yggg6mcykcnv41srl2sp2zwx2r38vb6a8jgxh1a4825mspm2jf7"; + sha256 = "08m4h2pf6hgi8igh2j0qzfq49izc2z0qqj6ddxk0di5l306jx4im"; }; meta = with stdenv.lib; { homepage = http://buildbot.net/; description = "Buildbot UI"; maintainers = with maintainers; [ nand0p ryansydnor ]; - platforms = platforms.all; license = licenses.gpl2; }; }; @@ -49,11 +47,11 @@ in { console-view = pythonPackages.buildPythonPackage rec { name = "${pname}-${version}"; pname = "buildbot-console-view"; - version = "0.9.3"; + version = "0.9.4"; src = fetchurl { url = "mirror://pypi/b/${pname}/${name}.tar.gz"; - sha256 = "1rkzakm05x72nvdivc5bc3gab3nyasdfvlwnwril90jj9q1b92dk"; + sha256 = "1w2vv8iyzl7ak4161avp9n6mhh08adav2fl82bbm17a3064apl8n"; }; propagatedBuildInputs = with pythonPackages; [ buildbot-pkg ]; @@ -62,7 +60,6 @@ in { homepage = http://buildbot.net/; description = "Buildbot Console View Plugin"; maintainers = with maintainers; [ nand0p ryansydnor ]; - platforms = platforms.all; license = licenses.gpl2; }; }; @@ -70,11 +67,11 @@ in { waterfall-view = pythonPackages.buildPythonPackage rec { name = "${pname}-${version}"; pname = "buildbot-waterfall-view"; - version = "0.9.3"; + version = "0.9.4"; src = fetchurl { url = "mirror://pypi/b/${pname}/${name}.tar.gz"; - sha256 = "033x2cs0znhk1j0lw067nmjw2m7yy1fdq5qch0sx50jnpjiq6g6g"; + sha256 = "17xn6vrr0k2xabw6hr9sdyy0ry3llyjfmc79qrpgp5bsly2qv3jf"; }; propagatedBuildInputs = with pythonPackages; [ buildbot-pkg ]; @@ -83,7 +80,6 @@ in { homepage = http://buildbot.net/; description = "Buildbot Waterfall View Plugin"; maintainers = with maintainers; [ nand0p ryansydnor ]; - platforms = platforms.all; license = licenses.gpl2; }; }; diff --git a/pkgs/development/tools/build-managers/buildbot/worker.nix b/pkgs/development/tools/build-managers/buildbot/worker.nix index 861ed647c5df..3023555d22c1 100644 --- a/pkgs/development/tools/build-managers/buildbot/worker.nix +++ b/pkgs/development/tools/build-managers/buildbot/worker.nix @@ -3,11 +3,11 @@ pythonPackages.buildPythonApplication (rec { name = "${pname}-${version}"; pname = "buildbot-worker"; - version = "0.9.3"; + version = "0.9.4"; src = fetchurl { url = "mirror://pypi/b/${pname}/${name}.tar.gz"; - sha256 = "176kp04g4c7gj15f73wppraqrirbfclyx214gcz966019niikcsp"; + sha256 = "0rdrr8x7sn2nxl51p6h9ad42s3c28lb6sys84zrg0d7fm4zhv7hj"; }; buildInputs = with pythonPackages; [ setuptoolsTrial mock ]; @@ -21,7 +21,6 @@ pythonPackages.buildPythonApplication (rec { homepage = http://buildbot.net/; description = "Buildbot Worker Daemon"; maintainers = with maintainers; [ nand0p ryansydnor ]; - platforms = platforms.all; license = licenses.gpl2; }; })