2022-09-29 10:44:04 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitLab, fetchurl, bash }:
|
2016-09-17 11:07:26 +00:00
|
|
|
|
|
|
|
let
|
2023-04-25 12:38:42 +00:00
|
|
|
version = "15.11.0";
|
2016-09-17 11:07:26 +00:00
|
|
|
in
|
2022-02-21 12:45:49 +00:00
|
|
|
buildGoModule rec {
|
2016-09-17 11:07:26 +00:00
|
|
|
inherit version;
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "gitlab-runner";
|
2022-02-21 12:45:49 +00:00
|
|
|
|
|
|
|
commonPackagePath = "gitlab.com/gitlab-org/gitlab-runner/common";
|
2021-08-26 03:31:57 +00:00
|
|
|
ldflags = [
|
|
|
|
"-X ${commonPackagePath}.NAME=gitlab-runner"
|
|
|
|
"-X ${commonPackagePath}.VERSION=${version}"
|
|
|
|
"-X ${commonPackagePath}.REVISION=v${version}"
|
|
|
|
];
|
2016-09-17 11:07:26 +00:00
|
|
|
|
2022-09-29 10:44:04 +00:00
|
|
|
# For patchShebangs
|
|
|
|
buildInputs = [ bash ];
|
|
|
|
|
2023-04-25 12:38:42 +00:00
|
|
|
vendorHash = "sha256-4eSfNo5S/eottEN4AptGJq6pBDHkNud0Nj5GrqutADM=";
|
2022-02-21 12:45:49 +00:00
|
|
|
|
2016-09-17 11:07:26 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "gitlab-org";
|
2017-09-29 14:00:25 +00:00
|
|
|
repo = "gitlab-runner";
|
2016-09-17 11:07:26 +00:00
|
|
|
rev = "v${version}";
|
2023-04-25 12:38:42 +00:00
|
|
|
sha256 = "sha256-S4KdEepNWv8J5+r/GT8+8kAKU5fq2iwQU+qyoCY1s0o=";
|
2016-09-17 11:07:26 +00:00
|
|
|
};
|
|
|
|
|
2021-12-11 09:12:18 +00:00
|
|
|
patches = [
|
|
|
|
./fix-shell-path.patch
|
2022-03-22 14:39:37 +00:00
|
|
|
./remove-bash-test.patch
|
2021-12-11 09:12:18 +00:00
|
|
|
];
|
2017-05-22 21:26:15 +00:00
|
|
|
|
2022-02-21 12:45:49 +00:00
|
|
|
prePatch = ''
|
|
|
|
# Remove some tests that can't work during a nix build
|
|
|
|
|
|
|
|
# Requires to run in a git repo
|
|
|
|
sed -i "s/func TestCacheArchiverAddingUntrackedFiles/func OFF_TestCacheArchiverAddingUntrackedFiles/" commands/helpers/file_archiver_test.go
|
|
|
|
sed -i "s/func TestCacheArchiverAddingUntrackedUnicodeFiles/func OFF_TestCacheArchiverAddingUntrackedUnicodeFiles/" commands/helpers/file_archiver_test.go
|
|
|
|
|
|
|
|
# No writable developer environment
|
|
|
|
rm common/build_test.go
|
|
|
|
rm executors/custom/custom_test.go
|
|
|
|
|
|
|
|
# No docker during build
|
|
|
|
rm executors/docker/terminal_test.go
|
|
|
|
rm executors/docker/docker_test.go
|
|
|
|
rm helpers/docker/auth/auth_test.go
|
2022-12-19 17:04:51 +00:00
|
|
|
rm executors/docker/services_test.go
|
2022-02-21 12:45:49 +00:00
|
|
|
'';
|
|
|
|
|
2022-09-29 10:44:04 +00:00
|
|
|
postInstall = ''
|
|
|
|
install packaging/root/usr/share/gitlab-runner/clear-docker-cache $out/bin
|
|
|
|
'';
|
|
|
|
|
2022-02-21 12:45:49 +00:00
|
|
|
preCheck = ''
|
|
|
|
# Make the tests pass outside of GitLab CI
|
|
|
|
export CI=0
|
|
|
|
'';
|
|
|
|
|
2016-09-17 11:07:26 +00:00
|
|
|
meta = with lib; {
|
2016-12-25 11:35:47 +00:00
|
|
|
description = "GitLab Runner the continuous integration executor of GitLab";
|
2016-09-17 11:07:26 +00:00
|
|
|
license = licenses.mit;
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://about.gitlab.com/gitlab-ci/";
|
2017-05-24 10:18:56 +00:00
|
|
|
platforms = platforms.unix ++ platforms.darwin;
|
2022-05-06 10:40:40 +00:00
|
|
|
maintainers = with maintainers; [ bachp zimbatm globin yayayayaka ];
|
2016-09-17 11:07:26 +00:00
|
|
|
};
|
|
|
|
}
|