2018-07-29 21:59:11 +03:00
|
|
|
{ lib, buildGoPackage, fetchFromGitLab, fetchurl }:
|
2016-09-17 14:07:26 +03:00
|
|
|
|
|
|
|
let
|
2020-10-05 15:46:20 +03:00
|
|
|
version = "13.4.1";
|
2019-08-12 16:06:15 +03:00
|
|
|
# Gitlab runner embeds some docker images these are prebuilt for arm and x86_64
|
|
|
|
docker_x86_64 = fetchurl {
|
|
|
|
url = "https://gitlab-runner-downloads.s3.amazonaws.com/v${version}/helper-images/prebuilt-x86_64.tar.xz";
|
2020-10-05 15:46:20 +03:00
|
|
|
sha256 = "0yc4yfqhh51p0nz0sl2qfp48n431qgp23wn3aqq3jg4fh9578prb";
|
2019-08-12 16:06:15 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
docker_arm = fetchurl {
|
|
|
|
url = "https://gitlab-runner-downloads.s3.amazonaws.com/v${version}/helper-images/prebuilt-arm.tar.xz";
|
2020-10-05 15:46:20 +03:00
|
|
|
sha256 = "1n50izz21dmd14qm6y9fsgwf5f0r9829dv79mvlqxmh1q87acm93";
|
2019-08-12 16:06:15 +03:00
|
|
|
};
|
2016-09-17 14:07:26 +03:00
|
|
|
in
|
|
|
|
buildGoPackage rec {
|
|
|
|
inherit version;
|
2019-08-15 15:41:18 +03:00
|
|
|
pname = "gitlab-runner";
|
2017-09-29 17:00:25 +03:00
|
|
|
goPackagePath = "gitlab.com/gitlab-org/gitlab-runner";
|
2020-07-01 12:43:31 +03:00
|
|
|
subPackages = [ "." ];
|
2016-09-17 14:07:26 +03:00
|
|
|
commonPackagePath = "${goPackagePath}/common";
|
|
|
|
buildFlagsArray = ''
|
|
|
|
-ldflags=
|
|
|
|
-X ${commonPackagePath}.NAME=gitlab-runner
|
|
|
|
-X ${commonPackagePath}.VERSION=${version}
|
|
|
|
-X ${commonPackagePath}.REVISION=v${version}
|
|
|
|
'';
|
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "gitlab-org";
|
2017-09-29 17:00:25 +03:00
|
|
|
repo = "gitlab-runner";
|
2016-09-17 14:07:26 +03:00
|
|
|
rev = "v${version}";
|
2020-10-05 15:46:20 +03:00
|
|
|
sha256 = "10k3xn3fapwx52s3r3pk972k1s7793cgja7g1fvm06pic8l7q05g";
|
2016-09-17 14:07:26 +03:00
|
|
|
};
|
|
|
|
|
2017-05-23 23:34:22 +03:00
|
|
|
patches = [ ./fix-shell-path.patch ];
|
2017-05-23 00:26:15 +03:00
|
|
|
|
2019-08-12 16:06:15 +03:00
|
|
|
postInstall = ''
|
2020-04-28 04:50:57 +03:00
|
|
|
install -d $out/bin/helper-images
|
|
|
|
ln -sf ${docker_x86_64} $out/bin/helper-images/prebuilt-x86_64.tar.xz
|
|
|
|
ln -sf ${docker_arm} $out/bin/helper-images/prebuilt-arm.tar.xz
|
2019-08-12 16:06:15 +03:00
|
|
|
'';
|
|
|
|
|
2016-09-17 14:07:26 +03:00
|
|
|
meta = with lib; {
|
2016-12-25 14:35:47 +03:00
|
|
|
description = "GitLab Runner the continuous integration executor of GitLab";
|
2016-09-17 14:07:26 +03:00
|
|
|
license = licenses.mit;
|
2020-04-01 04:11:51 +03:00
|
|
|
homepage = "https://about.gitlab.com/gitlab-ci/";
|
2017-05-24 13:18:56 +03:00
|
|
|
platforms = platforms.unix ++ platforms.darwin;
|
2019-08-20 20:36:05 +03:00
|
|
|
maintainers = with maintainers; [ bachp zimbatm globin ];
|
2016-09-17 14:07:26 +03:00
|
|
|
};
|
|
|
|
}
|