nixpkgs/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix
Pascal Bach 824f2e2a28 gitlab-runner: 9.5.0 -> 10.0.0 (#29821)
The renaming of gitlab-ci-mutli-runner to gitlab-runner
is finally complete. Symlinking is thus no longer needed.
2017-09-29 14:00:25 +00:00

67 lines
2.0 KiB
Nix

{ lib, buildGoPackage, fetchFromGitLab, fetchurl, go-bindata }:
let
version = "10.0.0";
# 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}/docker/prebuilt-x86_64.tar.xz";
sha256 = "13rfpyzrld20pjhkjzx78qfdmi4w86v6nhq3460bcjpi4kwyd24w";
};
docker_arm = fetchurl {
url = "https://gitlab-runner-downloads.s3.amazonaws.com/v${version}/docker/prebuilt-arm.tar.xz";
sha256 = "19z3rmkmv6z6g27bsjkqkfj8xwpyf9v1fhk2vb81xj5fisjzhmlw";
};
in
buildGoPackage rec {
inherit version;
name = "gitlab-runner-${version}";
goPackagePath = "gitlab.com/gitlab-org/gitlab-runner";
commonPackagePath = "${goPackagePath}/common";
buildFlagsArray = ''
-ldflags=
-X ${commonPackagePath}.NAME=gitlab-runner
-X ${commonPackagePath}.VERSION=${version}
-X ${commonPackagePath}.REVISION=v${version}
'';
src = fetchFromGitLab {
owner = "gitlab-org";
repo = "gitlab-runner";
rev = "v${version}";
sha256 = "11gp6l5kqcz4spxq552hsnw480vdhp70zmqlgjr906px3r31j7h3";
};
patches = [ ./fix-shell-path.patch ];
buildInputs = [ go-bindata ];
preBuild = ''
(
# go-bindata names the assets after the filename thus we create a symlink with the name we want
cd go/src/${goPackagePath}
ln -sf ${docker_x86_64} prebuilt-x86_64.tar.xz
ln -sf ${docker_arm} prebuilt-arm.tar.xz
go-bindata \
-pkg docker \
-nocompress \
-nomemcopy \
-o executors/docker/bindata.go \
prebuilt-x86_64.tar.xz \
prebuilt-arm.tar.xz
)
'';
postInstall = ''
install -d $out/bin
'';
meta = with lib; {
description = "GitLab Runner the continuous integration executor of GitLab";
license = licenses.mit;
homepage = https://about.gitlab.com/gitlab-ci/;
platforms = platforms.unix ++ platforms.darwin;
maintainers = with maintainers; [ bachp zimbatm ];
};
}