mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-03 13:30:36 +00:00
gitlab-ci-verify: init at 2.11.8
This commit is contained in:
65
pkgs/by-name/gi/gitlab-ci-verify/package.nix
Normal file
65
pkgs/by-name/gi/gitlab-ci-verify/package.nix
Normal file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
writableTmpDirAsHomeHook,
|
||||
versionCheckHook,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "gitlab-ci-verify";
|
||||
version = "2.11.8";
|
||||
__structuredAttrs = true;
|
||||
__darwinAllowLocalNetworking = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "timo-reymann";
|
||||
repo = "gitlab-ci-verify";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-/HzVfaRBPfG+YjHHzwE5ROYBjR+8Lqxusku7l46oXaM=";
|
||||
fetchSubmodules = true;
|
||||
leaveDotGit = true;
|
||||
postFetch = ''
|
||||
cd "$out"
|
||||
git rev-parse HEAD > $out/COMMIT
|
||||
date -u -d "@$(git log -1 --pretty=%ct)" "+%Y-%m-%dT%H:%M:%SZ" > $out/SOURCE_DATE_EPOCH
|
||||
find "$out" -name .git -print0 | xargs -0 rm -rf
|
||||
'';
|
||||
};
|
||||
|
||||
vendorHash = "sha256-o7NL6Ijh+ZEUhEYlzypM0KPh8XtMXeTzB9VBB7bPlco=";
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
];
|
||||
|
||||
# Using -X github.com/timo-reymann/gitlab-ci-verify/internal/buildinfo.Version does not work
|
||||
preBuild = ''
|
||||
substituteInPlace internal/buildinfo/main.go \
|
||||
--replace-fail "unknown" "$(cat COMMIT)" \
|
||||
--replace-fail "Version = \"?\"" "Version = \"${finalAttrs.version}\"" \
|
||||
--replace-fail "BuildTime = \"?\"" "BuildTime = \"$(cat SOURCE_DATE_EPOCH)\""
|
||||
'';
|
||||
|
||||
doCheck = true;
|
||||
|
||||
nativeCheckInputs = [
|
||||
writableTmpDirAsHomeHook
|
||||
];
|
||||
|
||||
doInstallCheck = true;
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
description = "Validate and lint your gitlab ci files using ShellCheck, the Gitlab API, curated checks or even build your own checks";
|
||||
homepage = "https://github.com/timo-reymann/gitlab-ci-verify";
|
||||
changelog = "https://github.com/timo-reymann/gitlab-ci-verify/blob/${finalAttrs.src.tag}/CHANGELOG.md";
|
||||
license = lib.licenses.gpl3Only;
|
||||
maintainers = with lib.maintainers; [ drupol ];
|
||||
mainProgram = "gitlab-ci-verify";
|
||||
};
|
||||
})
|
||||
Reference in New Issue
Block a user