2024-06-05 15:53:02 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitLab, bash }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2024-06-24 18:47:55 +00:00
|
|
|
version = "17.1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
2022-03-05 16:20:37 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit version;
|
|
|
|
pname = "gitlab-runner";
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
commonPackagePath = "gitlab.com/gitlab-org/gitlab-runner/common";
|
2021-08-27 14:25:00 +00:00
|
|
|
ldflags = [
|
|
|
|
"-X ${commonPackagePath}.NAME=gitlab-runner"
|
|
|
|
"-X ${commonPackagePath}.VERSION=${version}"
|
|
|
|
"-X ${commonPackagePath}.REVISION=v${version}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
# For patchShebangs
|
|
|
|
buildInputs = [ bash ];
|
|
|
|
|
2024-06-24 18:47:55 +00:00
|
|
|
vendorHash = "sha256-Rk5/h8wqVwGzovtAjjNkvexG71Dj36mFxU8OsLJzpUo=";
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "gitlab-org";
|
|
|
|
repo = "gitlab-runner";
|
|
|
|
rev = "v${version}";
|
2024-06-24 18:47:55 +00:00
|
|
|
sha256 = "sha256-mRL62PIAkPK0aLA7uYpGlUvaJfbD354RDOD4P8MLzx8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
patches = [
|
|
|
|
./fix-shell-path.patch
|
2022-03-30 09:31:56 +00:00
|
|
|
./remove-bash-test.patch
|
2021-12-19 01:06:50 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-05 16:20:37 +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
|
2024-04-21 15:54:59 +00:00
|
|
|
rm common/build_settings_test.go
|
2022-03-05 16:20:37 +00:00
|
|
|
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-28 21:21:41 +00:00
|
|
|
rm executors/docker/services_test.go
|
2022-03-05 16:20:37 +00:00
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
excludedPackages = [
|
|
|
|
# CI helper script for pushing images to Docker and ECR registries
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/4139
|
|
|
|
"./scripts/sync-docker-images"
|
|
|
|
];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
postInstall = ''
|
|
|
|
install packaging/root/usr/share/gitlab-runner/clear-docker-cache $out/bin
|
|
|
|
'';
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
preCheck = ''
|
|
|
|
# Make the tests pass outside of GitLab CI
|
|
|
|
export CI=0
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "GitLab Runner the continuous integration executor of GitLab";
|
|
|
|
license = licenses.mit;
|
2024-04-21 15:54:59 +00:00
|
|
|
homepage = "https://docs.gitlab.com/runner/";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix ++ platforms.darwin;
|
2023-11-16 04:20:00 +00:00
|
|
|
maintainers = with maintainers; [ bachp zimbatm ] ++ teams.gitlab.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|