2021-02-05 17:12:51 +00:00
|
|
|
|
{ fetchFromGitHub, lib, buildGoModule,
|
2021-05-20 23:08:51 +00:00
|
|
|
|
makeWrapper, coreutils, git, openssh, bash, gnused, gnugrep,
|
|
|
|
|
nixosTests }:
|
2020-11-03 02:18:15 +00:00
|
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
name = "buildkite-agent-${version}";
|
2021-07-24 12:14:16 +00:00
|
|
|
|
version = "3.31.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "buildkite";
|
|
|
|
|
repo = "agent";
|
|
|
|
|
rev = "v${version}";
|
2021-07-24 12:14:16 +00:00
|
|
|
|
sha256 = "sha256-Rot5A2zSEleTifadHEvAlydchzCdDo/VPZELostDfng=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
2020-11-03 02:18:15 +00:00
|
|
|
|
|
2021-05-29 03:34:57 +00:00
|
|
|
|
vendorSha256 = "sha256-n3XRxpEKjHf7L7fcGscWTVKBtot9waZbLoS9cG0kHfI=";
|
2020-11-03 02:18:15 +00:00
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
postPatch = ''
|
|
|
|
|
substituteInPlace bootstrap/shell/shell.go --replace /bin/bash ${bash}/bin/bash
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
|
doCheck = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
|
# Fix binary name
|
2020-05-15 21:57:56 +00:00
|
|
|
|
mv $out/bin/{agent,buildkite-agent}
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
# These are runtime dependencies
|
2020-05-15 21:57:56 +00:00
|
|
|
|
wrapProgram $out/bin/buildkite-agent \
|
2021-02-05 17:12:51 +00:00
|
|
|
|
--prefix PATH : '${lib.makeBinPath [ openssh git coreutils gnused gnugrep ]}'
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
|
passthru.tests = {
|
|
|
|
|
smoke-test = nixosTests.buildkite-agents;
|
|
|
|
|
};
|
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "Build runner for buildkite.com";
|
|
|
|
|
longDescription = ''
|
|
|
|
|
The buildkite-agent is a small, reliable, and cross-platform build runner
|
|
|
|
|
that makes it easy to run automated builds on your own infrastructure.
|
|
|
|
|
It’s main responsibilities are polling buildkite.com for work, running
|
|
|
|
|
build jobs, reporting back the status code and output log of the job,
|
|
|
|
|
and uploading the job's artifacts.
|
|
|
|
|
'';
|
|
|
|
|
homepage = "https://buildkite.com/docs/agent";
|
|
|
|
|
license = licenses.mit;
|
|
|
|
|
maintainers = with maintainers; [ pawelpacana zimbatm rvl ];
|
2020-11-03 02:18:15 +00:00
|
|
|
|
platforms = with platforms; unix ++ darwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
}
|