nixpkgs/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
2.2 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitLab, fetchurl, bash }:
2016-09-17 14:07:26 +03:00
let
version = "16.5.0";
2016-09-17 14:07:26 +03:00
in
2022-02-21 15:45:49 +03:00
buildGoModule rec {
2016-09-17 14:07:26 +03:00
inherit version;
pname = "gitlab-runner";
2022-02-21 15:45:49 +03:00
commonPackagePath = "gitlab.com/gitlab-org/gitlab-runner/common";
2021-08-26 06:31:57 +03:00
ldflags = [
"-X ${commonPackagePath}.NAME=gitlab-runner"
"-X ${commonPackagePath}.VERSION=${version}"
"-X ${commonPackagePath}.REVISION=v${version}"
];
2016-09-17 14:07:26 +03:00
# For patchShebangs
buildInputs = [ bash ];
vendorHash = "sha256-C37ijxvyY9PG/Qn29Fmk0pxK+hq45kHIBveBltfIfTo=";
2022-02-21 15:45:49 +03:00
2016-09-17 14:07:26 +03:00
src = fetchFromGitLab {
owner = "gitlab-org";
repo = "gitlab-runner";
2016-09-17 14:07:26 +03:00
rev = "v${version}";
sha256 = "sha256-NLidtwn1zT7BxzMEF5K41fwbZaICA/KuAr8MIjpJD+A=";
2016-09-17 14:07:26 +03:00
};
patches = [
./fix-shell-path.patch
2022-03-22 17:39:37 +03:00
./remove-bash-test.patch
];
2022-02-21 15:45:49 +03: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
rm executors/docker/services_test.go
2022-02-21 15:45:49 +03: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"
];
postInstall = ''
install packaging/root/usr/share/gitlab-runner/clear-docker-cache $out/bin
'';
2022-02-21 15:45:49 +03:00
preCheck = ''
# Make the tests pass outside of GitLab CI
export CI=0
'';
2016-09-17 14:07:26 +03:00
meta = with lib; {
2016-12-25 14:35:47 +03:00
description = "GitLab Runner the continuous integration executor of GitLab";
2016-09-17 14:07:26 +03:00
license = licenses.mit;
homepage = "https://about.gitlab.com/gitlab-ci/";
2017-05-24 13:18:56 +03:00
platforms = platforms.unix ++ platforms.darwin;
maintainers = with maintainers; [ bachp zimbatm globin ] ++ teams.gitlab.members;
2016-09-17 14:07:26 +03:00
};
}