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