Merge pull request #68291 from Ma27/bump-hydra
hydra: 2019-05-06 -> 2019-08-30
This commit is contained in:
commit
cbb6293dce
@ -275,6 +275,7 @@ in
|
|||||||
${pkgs.sudo}/bin/sudo -u ${config.services.postgresql.superUser} ${config.services.postgresql.package}/bin/createdb -O hydra hydra
|
${pkgs.sudo}/bin/sudo -u ${config.services.postgresql.superUser} ${config.services.postgresql.package}/bin/createdb -O hydra hydra
|
||||||
touch ${baseDir}/.db-created
|
touch ${baseDir}/.db-created
|
||||||
fi
|
fi
|
||||||
|
echo "create extension if not exists pg_trgm" | ${pkgs.sudo}/bin/sudo -u ${config.services.postgresql.superUser} -- ${config.services.postgresql.package}/bin/psql hydra
|
||||||
''}
|
''}
|
||||||
|
|
||||||
if [ ! -e ${cfg.gcRootsDir} ]; then
|
if [ ! -e ${cfg.gcRootsDir} ]; then
|
||||||
@ -379,6 +380,23 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services.hydra-notify =
|
||||||
|
{ wantedBy = [ "multi-user.target" ];
|
||||||
|
requires = [ "hydra-init.service" ];
|
||||||
|
after = [ "hydra-init.service" ];
|
||||||
|
restartTriggers = [ hydraConf ];
|
||||||
|
environment = env // {
|
||||||
|
PGPASSFILE = "${baseDir}/pgpass-queue-runner";
|
||||||
|
};
|
||||||
|
serviceConfig =
|
||||||
|
{ ExecStart = "@${cfg.package}/bin/hydra-notify hydra-notify";
|
||||||
|
# FIXME: run this under a less privileged user?
|
||||||
|
User = "hydra-queue-runner";
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = 5;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# If there is less than a certain amount of free disk space, stop
|
# If there is less than a certain amount of free disk space, stop
|
||||||
# the queue/evaluator to prevent builds from failing or aborting.
|
# the queue/evaluator to prevent builds from failing or aborting.
|
||||||
systemd.services.hydra-check-space =
|
systemd.services.hydra-check-space =
|
||||||
@ -416,6 +434,8 @@ in
|
|||||||
hydra-users hydra-queue-runner hydra
|
hydra-users hydra-queue-runner hydra
|
||||||
hydra-users hydra-www hydra
|
hydra-users hydra-www hydra
|
||||||
hydra-users root hydra
|
hydra-users root hydra
|
||||||
|
# The postgres user is used to create the pg_trgm extension for the hydra database
|
||||||
|
hydra-users postgres postgres
|
||||||
'';
|
'';
|
||||||
|
|
||||||
services.postgresql.authentication = optionalString haveLocalDB
|
services.postgresql.authentication = optionalString haveLocalDB
|
||||||
|
@ -44,6 +44,8 @@ cat >data.json <<EOF
|
|||||||
"enabled": "1",
|
"enabled": "1",
|
||||||
"visible": "1",
|
"visible": "1",
|
||||||
"keepnr": "1",
|
"keepnr": "1",
|
||||||
|
"enableemail": true,
|
||||||
|
"emailoverride": "hydra@localhost",
|
||||||
"nixexprinput": "trivial",
|
"nixexprinput": "trivial",
|
||||||
"nixexprpath": "trivial.nix",
|
"nixexprpath": "trivial.nix",
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
@ -8,8 +8,10 @@ let
|
|||||||
trivialJob = pkgs.writeTextDir "trivial.nix" ''
|
trivialJob = pkgs.writeTextDir "trivial.nix" ''
|
||||||
{ trivial = builtins.derivation {
|
{ trivial = builtins.derivation {
|
||||||
name = "trivial";
|
name = "trivial";
|
||||||
system = "x86_64-linux";
|
system = "${system}";
|
||||||
builder = "/bin/sh";
|
builder = "/bin/sh";
|
||||||
|
allowSubstitutes = false;
|
||||||
|
preferLocalBuild = true;
|
||||||
args = ["-c" "echo success > $out; exit 0"];
|
args = ["-c" "echo success > $out; exit 0"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -53,11 +55,16 @@ let
|
|||||||
notificationSender = "example@example.com";
|
notificationSender = "example@example.com";
|
||||||
|
|
||||||
package = pkgs.hydra.override { inherit nix; };
|
package = pkgs.hydra.override { inherit nix; };
|
||||||
|
|
||||||
|
extraConfig = ''
|
||||||
|
email_notification = 1
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
services.postfix.enable = true;
|
||||||
nix = {
|
nix = {
|
||||||
buildMachines = [{
|
buildMachines = [{
|
||||||
hostName = "localhost";
|
hostName = "localhost";
|
||||||
systems = [ "x86_64-linux" ];
|
systems = [ system ];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
binaryCaches = [];
|
binaryCaches = [];
|
||||||
@ -68,12 +75,12 @@ let
|
|||||||
# let the system boot up
|
# let the system boot up
|
||||||
$machine->waitForUnit("multi-user.target");
|
$machine->waitForUnit("multi-user.target");
|
||||||
# test whether the database is running
|
# test whether the database is running
|
||||||
$machine->succeed("systemctl status postgresql.service");
|
$machine->waitForUnit("postgresql.service");
|
||||||
# test whether the actual hydra daemons are running
|
# test whether the actual hydra daemons are running
|
||||||
$machine->succeed("systemctl status hydra-queue-runner.service");
|
$machine->waitForUnit("hydra-init.service");
|
||||||
$machine->succeed("systemctl status hydra-init.service");
|
$machine->requireActiveUnit("hydra-queue-runner.service");
|
||||||
$machine->succeed("systemctl status hydra-evaluator.service");
|
$machine->requireActiveUnit("hydra-evaluator.service");
|
||||||
$machine->succeed("systemctl status hydra-send-stats.service");
|
$machine->requireActiveUnit("hydra-notify.service");
|
||||||
|
|
||||||
$machine->succeed("hydra-create-user admin --role admin --password admin");
|
$machine->succeed("hydra-create-user admin --role admin --password admin");
|
||||||
|
|
||||||
@ -84,6 +91,8 @@ let
|
|||||||
$machine->succeed("create-trivial-project.sh");
|
$machine->succeed("create-trivial-project.sh");
|
||||||
|
|
||||||
$machine->waitUntilSucceeds('curl -L -s http://localhost:3000/build/1 -H "Accept: application/json" | jq .buildstatus | xargs test 0 -eq');
|
$machine->waitUntilSucceeds('curl -L -s http://localhost:3000/build/1 -H "Accept: application/json" | jq .buildstatus | xargs test 0 -eq');
|
||||||
|
|
||||||
|
$machine->waitUntilSucceeds('journalctl -eu hydra-notify.service -o cat | grep -q "sending mail notification to hydra@localhost"');
|
||||||
'';
|
'';
|
||||||
})));
|
})));
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{ stdenv, nix, perlPackages, buildEnv, releaseTools, fetchFromGitHub
|
{ stdenv, nix, perlPackages, buildEnv, fetchFromGitHub
|
||||||
, makeWrapper, autoconf, automake, libtool, unzip, pkgconfig, sqlite, libpqxx
|
, makeWrapper, autoconf, automake, libtool, unzip, pkgconfig, sqlite, libpqxx
|
||||||
, gitAndTools, mercurial, darcs, subversion, bazaar, openssl, bzip2, libxslt
|
, gitAndTools, mercurial, darcs, subversion, bazaar, openssl, bzip2, libxslt
|
||||||
, guile, perl, postgresql, nukeReferences, git, boehmgc, nlohmann_json
|
, guile, perl, postgresql, nukeReferences, git, boehmgc, nlohmann_json
|
||||||
, docbook_xsl, openssh, gnused, coreutils, findutils, gzip, lzma, gnutar
|
, docbook_xsl, openssh, gnused, coreutils, findutils, gzip, lzma, gnutar
|
||||||
, rpm, dpkg, cdrkit, pixz, lib, fetchpatch, boost, autoreconfHook
|
, rpm, dpkg, cdrkit, pixz, lib, boost, autoreconfHook
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv;
|
with stdenv;
|
||||||
@ -67,17 +67,17 @@ let
|
|||||||
boehmgc
|
boehmgc
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in releaseTools.nixBuild rec {
|
in stdenv.mkDerivation rec {
|
||||||
pname = "hydra";
|
pname = "hydra";
|
||||||
version = "2019-05-06";
|
version = "2019-08-30";
|
||||||
|
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "NixOS";
|
owner = "NixOS";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "ff64583d07f046e378a6be596ec0ce7a9e2b7472";
|
rev = "242b8b7a314759ed33f69205d26a1b7c337511e0";
|
||||||
sha256 = "0w88q0saz7si22z3ryim6vdrv9qkwn6l25xfmiapvh5qrnrrdcb9";
|
sha256 = "167ijcf9qdm10kjvqax3hcvs5mpa4mx2y2i9idwwc6xfvn8fhs84";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
@ -97,13 +97,6 @@ in releaseTools.nixBuild rec {
|
|||||||
|
|
||||||
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
||||||
|
|
||||||
patches = [
|
|
||||||
(fetchpatch {
|
|
||||||
url = "https://github.com/NixOS/hydra/pull/648/commits/4171ab4c4fd576c516dc03ba64d1c7945f769af0.patch";
|
|
||||||
sha256 = "1fxa2459kdws6qc419dv4084c1ssmys7kqg4ic7n643kybamsgrx";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ];
|
configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ];
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = [ "-pthread" ];
|
NIX_CFLAGS_COMPILE = [ "-pthread" ];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user