nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, buildGoModule, fetchFromGitLab, fetchurl }:
2
3let
4 version = "15.0.0";
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 vendorSha256 = "0ag3pmcrxksgikdcvl9rv2s3kn7l0dj41pf2m9dq0g2a1j45nydn";
18
19 src = fetchFromGitLab {
20 owner = "gitlab-org";
21 repo = "gitlab-runner";
22 rev = "v${version}";
23 sha256 = "1s7jqhrwy5wl0db37d3pms499mmy7msx4ch46w5qa25nfbxcr07c";
24 };
25
26 patches = [
27 ./fix-shell-path.patch
28 ./remove-bash-test.patch
29 ];
30
31 prePatch = ''
32 # Remove some tests that can't work during a nix build
33
34 # Requires to run in a git repo
35 sed -i "s/func TestCacheArchiverAddingUntrackedFiles/func OFF_TestCacheArchiverAddingUntrackedFiles/" commands/helpers/file_archiver_test.go
36 sed -i "s/func TestCacheArchiverAddingUntrackedUnicodeFiles/func OFF_TestCacheArchiverAddingUntrackedUnicodeFiles/" commands/helpers/file_archiver_test.go
37
38 # No writable developer environment
39 rm common/build_test.go
40 rm executors/custom/custom_test.go
41
42 # No docker during build
43 rm executors/docker/terminal_test.go
44 rm executors/docker/docker_test.go
45 rm helpers/docker/auth/auth_test.go
46 '';
47
48 preCheck = ''
49 # Make the tests pass outside of GitLab CI
50 export CI=0
51 '';
52
53 meta = with lib; {
54 description = "GitLab Runner the continuous integration executor of GitLab";
55 license = licenses.mit;
56 homepage = "https://about.gitlab.com/gitlab-ci/";
57 platforms = platforms.unix ++ platforms.darwin;
58 maintainers = with maintainers; [ bachp zimbatm globin yayayayaka ];
59 };
60}