2020-01-19 21:50:52 +01:00
|
|
|
import ./make-test-python.nix ({ pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "buildkite-agent";
|
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
|
|
|
maintainers = [ flokli ];
|
|
|
|
};
|
|
|
|
|
2020-01-21 14:21:57 +01:00
|
|
|
nodes = {
|
|
|
|
node1 = { pkgs, ... }: {
|
|
|
|
services.buildkite-agent = {
|
|
|
|
enable = true;
|
|
|
|
privateSshKeyPath = (import ./ssh-keys.nix pkgs).snakeOilPrivateKey;
|
|
|
|
tokenPath = (pkgs.writeText "my-token" "5678");
|
|
|
|
};
|
|
|
|
};
|
|
|
|
# don't configure ssh key, run as a separate user
|
|
|
|
node2 = { pkgs, ...}: {
|
|
|
|
services.buildkite-agent = {
|
|
|
|
enable = true;
|
|
|
|
tokenPath = (pkgs.writeText "my-token" "1234");
|
|
|
|
};
|
2020-01-19 21:50:52 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2020-01-21 14:21:57 +01:00
|
|
|
start_all()
|
2020-01-19 21:50:52 +01:00
|
|
|
# we can't wait on the unit to start up, as we obviously can't connect to buildkite,
|
|
|
|
# but we can look whether files are set up correctly
|
2020-01-21 14:21:57 +01:00
|
|
|
|
|
|
|
node1.wait_for_file("/var/lib/buildkite-agent/buildkite-agent.cfg")
|
|
|
|
node1.wait_for_file("/var/lib/buildkite-agent/.ssh/id_rsa")
|
|
|
|
|
|
|
|
node2.wait_for_file("/var/lib/buildkite-agent/buildkite-agent.cfg")
|
2020-01-19 21:50:52 +01:00
|
|
|
'';
|
|
|
|
})
|