1{ lib, buildGoModule, fetchFromGitLab, fetchurl, bash }: 2 3let 4 version = "15.5.1"; 5in 6buildGoModule rec { 7 inherit version; 8 pname = "gitlab-runner"; 9 10 commonPackagePath = "gitlab.com/gitlab-org/gitlab-runner/common"; 11 ldflags = [ 12 "-X ${commonPackagePath}.NAME=gitlab-runner" 13 "-X ${commonPackagePath}.VERSION=${version}" 14 "-X ${commonPackagePath}.REVISION=v${version}" 15 ]; 16 17 # For patchShebangs 18 buildInputs = [ bash ]; 19 20 vendorSha256 = "sha256-IcsYH1V3b5IUY2JqOADJrc4lkng1GS7lndfHObRQbxU="; 21 22 src = fetchFromGitLab { 23 owner = "gitlab-org"; 24 repo = "gitlab-runner"; 25 rev = "v${version}"; 26 sha256 = "sha256-ZvQaA4DSuEIdHEoRKJg5tOnBQgf26paTAiWy6RLRG3o="; 27 }; 28 29 patches = [ 30 ./fix-shell-path.patch 31 ./remove-bash-test.patch 32 ]; 33 34 prePatch = '' 35 # Remove some tests that can't work during a nix build 36 37 # Requires to run in a git repo 38 sed -i "s/func TestCacheArchiverAddingUntrackedFiles/func OFF_TestCacheArchiverAddingUntrackedFiles/" commands/helpers/file_archiver_test.go 39 sed -i "s/func TestCacheArchiverAddingUntrackedUnicodeFiles/func OFF_TestCacheArchiverAddingUntrackedUnicodeFiles/" commands/helpers/file_archiver_test.go 40 41 # No writable developer environment 42 rm common/build_test.go 43 rm executors/custom/custom_test.go 44 45 # No docker during build 46 rm executors/docker/terminal_test.go 47 rm executors/docker/docker_test.go 48 rm helpers/docker/auth/auth_test.go 49 ''; 50 51 postInstall = '' 52 install packaging/root/usr/share/gitlab-runner/clear-docker-cache $out/bin 53 ''; 54 55 preCheck = '' 56 # Make the tests pass outside of GitLab CI 57 export CI=0 58 ''; 59 60 meta = with lib; { 61 description = "GitLab Runner the continuous integration executor of GitLab"; 62 license = licenses.mit; 63 homepage = "https://about.gitlab.com/gitlab-ci/"; 64 platforms = platforms.unix ++ platforms.darwin; 65 maintainers = with maintainers; [ bachp zimbatm globin yayayayaka ]; 66 }; 67}