2018-07-29 11:59:11 -07:00
|
|
|
{ lib, buildGoPackage, fetchFromGitLab, fetchurl }:
|
2016-09-17 04:07:26 -07:00
|
|
|
|
|
|
|
let
|
2021-01-21 02:07:03 -08:00
|
|
|
version = "13.8.0";
|
2019-08-12 06:06:15 -07: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";
|
2021-01-21 02:07:03 -08:00
|
|
|
sha256 = "15pf6mxma8gkzyxkzm1rjwa514p7gzabn3c474lcvsjpmp76wv68";
|
2019-08-12 06:06:15 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
docker_arm = fetchurl {
|
|
|
|
url = "https://gitlab-runner-downloads.s3.amazonaws.com/v${version}/helper-images/prebuilt-arm.tar.xz";
|
2021-01-21 02:07:03 -08:00
|
|
|
sha256 = "1c4lpy7nc62rqk8bfwiy5pcgvcwx70qkz3lv9w512fr3n5hjd4c0";
|
2019-08-12 06:06:15 -07:00
|
|
|
};
|
2016-09-17 04:07:26 -07:00
|
|
|
in
|
|
|
|
buildGoPackage rec {
|
|
|
|
inherit version;
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "gitlab-runner";
|
2017-09-29 07:00:25 -07:00
|
|
|
goPackagePath = "gitlab.com/gitlab-org/gitlab-runner";
|
2020-07-01 02:43:31 -07:00
|
|
|
subPackages = [ "." ];
|
2016-09-17 04:07:26 -07: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 07:00:25 -07:00
|
|
|
repo = "gitlab-runner";
|
2016-09-17 04:07:26 -07:00
|
|
|
rev = "v${version}";
|
2021-01-21 02:07:03 -08:00
|
|
|
sha256 = "0v0iqpllzaabkahlc5pidzzw0bjlli984pdna3f3bbg67lm5a421";
|
2016-09-17 04:07:26 -07:00
|
|
|
};
|
|
|
|
|
2017-05-23 13:34:22 -07:00
|
|
|
patches = [ ./fix-shell-path.patch ];
|
2017-05-22 14:26:15 -07:00
|
|
|
|
2019-08-12 06:06:15 -07:00
|
|
|
postInstall = ''
|
2020-04-27 18:50:57 -07: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 06:06:15 -07:00
|
|
|
'';
|
|
|
|
|
2016-09-17 04:07:26 -07:00
|
|
|
meta = with lib; {
|
2016-12-25 03:35:47 -08:00
|
|
|
description = "GitLab Runner the continuous integration executor of GitLab";
|
2016-09-17 04:07:26 -07:00
|
|
|
license = licenses.mit;
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://about.gitlab.com/gitlab-ci/";
|
2017-05-24 03:18:56 -07:00
|
|
|
platforms = platforms.unix ++ platforms.darwin;
|
2019-08-20 10:36:05 -07:00
|
|
|
maintainers = with maintainers; [ bachp zimbatm globin ];
|
2016-09-17 04:07:26 -07:00
|
|
|
};
|
|
|
|
}
|