release.nix: Get rid of the "system" argument

This commit is contained in:
Eelco Dolstra 2013-07-01 19:37:14 +02:00
parent fe030331b5
commit 663b6a747b

View file

@ -2,7 +2,13 @@
, officialRelease ? false , officialRelease ? false
}: }:
rec { let
pkgs = import <nixpkgs> {};
genAttrs' = pkgs.lib.genAttrs [ "x86_64-linux" "i686-linux" ];
in rec {
tarball = tarball =
with import <nixpkgs> { }; with import <nixpkgs> { };
@ -40,12 +46,9 @@ rec {
}; };
build = build = genAttrs' (system:
{ system ? "x86_64-linux" }:
let pkgs = import <nixpkgs> {inherit system;}; in with import <nixpkgs> { inherit system; };
with pkgs;
let let
@ -133,46 +136,35 @@ rec {
LOGNAME = "foo"; LOGNAME = "foo";
meta.description = "Build of Hydra on ${system}"; meta.description = "Build of Hydra on ${system}";
}; });
tests = tests.install = genAttrs' (system:
{ nixos ? ../nixos, system ? "x86_64-linux" }:
let hydra = build { inherit system; }; in
with import <nixos/lib/testing.nix> { inherit system; }; with import <nixos/lib/testing.nix> { inherit system; };
let hydra = builtins.getAttr system build; in # build.${system}
simpleTest {
machine =
{ config, pkgs, ... }:
{ services.postgresql.enable = true;
services.postgresql.package = pkgs.postgresql92;
environment.systemPackages = [ hydra ];
};
{ testScript =
''
$machine->waitForJob("postgresql");
install = simpleTest { # Initialise the database and the state.
$machine->mustSucceed
machine = ( "createdb -O root hydra",
{ config, pkgs, ... }: , "psql hydra -f ${hydra}/libexec/hydra/sql/hydra-postgresql.sql"
{ services.postgresql.enable = true; , "mkdir /var/lib/hydra"
services.postgresql.package = pkgs.postgresql92; );
environment.systemPackages = [ hydra ];
};
testScript =
''
$machine->waitForJob("postgresql");
# Initialise the database and the state.
$machine->mustSucceed
( "createdb -O root hydra",
, "psql hydra -f ${hydra}/libexec/hydra/sql/hydra-postgresql.sql"
, "mkdir /var/lib/hydra"
);
# Start the web interface.
$machine->mustSucceed("HYDRA_DATA=/var/lib/hydra HYDRA_DBI='dbi:Pg:dbname=hydra;user=hydra;' hydra-server >&2 &");
$machine->waitForOpenPort("3000");
'';
};
};
# Start the web interface.
$machine->mustSucceed("HYDRA_DATA=/var/lib/hydra HYDRA_DBI='dbi:Pg:dbname=hydra;user=hydra;' hydra-server >&2 &");
$machine->waitForOpenPort("3000");
'';
});
} }