2023-07-29 01:27:17 +00:00
|
|
|
import ./make-test-python.nix ({ lib, pkgs, ... }:
|
2020-01-19 20:50:52 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
name = "buildkite-agent";
|
2023-07-29 01:27:17 +00:00
|
|
|
meta.maintainers = with lib.maintainers; [ flokli ];
|
2020-01-19 20:50:52 +00:00
|
|
|
|
2022-03-20 23:15:30 +00:00
|
|
|
nodes.machine = { pkgs, ... }: {
|
2020-01-23 16:19:53 +00:00
|
|
|
services.buildkite-agents = {
|
|
|
|
one = {
|
2020-01-21 13:21:57 +00:00
|
|
|
privateSshKeyPath = (import ./ssh-keys.nix pkgs).snakeOilPrivateKey;
|
|
|
|
tokenPath = (pkgs.writeText "my-token" "5678");
|
|
|
|
};
|
2020-01-23 16:19:53 +00:00
|
|
|
two = {
|
2020-01-21 13:21:57 +00:00
|
|
|
tokenPath = (pkgs.writeText "my-token" "1234");
|
|
|
|
};
|
2020-01-19 20:50:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2020-01-21 13:21:57 +00:00
|
|
|
start_all()
|
2020-01-19 20:50:52 +00: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 13:21:57 +00:00
|
|
|
|
2020-01-23 16:19:53 +00:00
|
|
|
machine.wait_for_file("/var/lib/buildkite-agent-one/buildkite-agent.cfg")
|
|
|
|
machine.wait_for_file("/var/lib/buildkite-agent-one/.ssh/id_rsa")
|
2020-01-21 13:21:57 +00:00
|
|
|
|
2020-01-23 16:19:53 +00:00
|
|
|
machine.wait_for_file("/var/lib/buildkite-agent-two/buildkite-agent.cfg")
|
2020-01-19 20:50:52 +00:00
|
|
|
'';
|
|
|
|
})
|