matomo: 5.2.1 -> 5.2.2 (#376385)
[NixPkgs.git] / pkgs / by-name / de / dependabot-cli / package.nix
blobc83fdb474c9ef770e3c2ed59219c44a43ba58cbe
2   buildGoModule,
3   dependabot-cli,
4   dockerTools,
5   fetchFromGitHub,
6   installShellFiles,
7   lib,
8   makeWrapper,
9   symlinkJoin,
10   testers,
12 let
13   pname = "dependabot-cli";
14   version = "1.57.0";
16   # vv Also update this vv
17   tag = "nixpkgs-dependabot-cli-${version}";
18   updateJobProxy = dockerTools.pullImage {
19     imageName = "ghcr.io/github/dependabot-update-job-proxy/dependabot-update-job-proxy";
20     # Get these hashes from
21     # nix run nixpkgs#nix-prefetch-docker -- --image-name ghcr.io/github/dependabot-update-job-proxy/dependabot-update-job-proxy --image-tag latest --final-image-name dependabot-update-job-proxy --final-image-tag ${tag}
22     imageDigest = "sha256:cc4a9b7db8ddf3924b6c25cc8a74d9937bf803e64733035809862a1c0a6df984";
23     sha256 = "0wkr0rac7dp1080s4zik5yzi5967gkfylly2148ipgw50sp0sq8s";
25     # Don't update this, it's used to refer to the imported image later
26     finalImageName = "dependabot-update-job-proxy";
27     finalImageTag = tag;
28   };
29   updaterGitHubActions = dockerTools.pullImage {
30     imageName = "ghcr.io/dependabot/dependabot-updater-github-actions";
31     # Get these hashes from
32     # nix run nixpkgs#nix-prefetch-docker -- --image-name ghcr.io/dependabot/dependabot-updater-github-actions --image-tag latest --final-image-name dependabot-updater-github-actions --final-image-tag ${tag}
33     imageDigest = "sha256:6665b3e26ef97577e83f2dfd0007a73c02b003126e72c0b4b196fe570088ed93";
34     sha256 = "0q7w3yp49wb70gkjjl2syvs75hm1jkva2qslzckwxh73z0kq2z0q";
36     # Don't update this, it's used to refer to the imported image later
37     finalImageName = "dependabot-updater-github-actions";
38     finalImageTag = tag;
39   };
41 buildGoModule {
42   inherit pname version;
44   src = fetchFromGitHub {
45     owner = "dependabot";
46     repo = "cli";
47     rev = "v${version}";
48     hash = "sha256-ZT1fwDT19uUjp5iG0NLSrc/6PLW/sukAd0w66mLdFVg=";
49   };
51   vendorHash = "sha256-jSINiETadd0ixzFBilgphi1vJNsRYeDkbaVNk5stTp4=";
53   ldflags = [
54     "-s"
55     "-w"
56     "-X github.com/dependabot/cli/cmd/dependabot/internal/cmd.version=v${version}"
57   ];
59   nativeBuildInputs = [
60     makeWrapper
61     installShellFiles
62   ];
64   postInstall = ''
65     installShellCompletion --cmd dependabot \
66       --bash <($out/bin/dependabot completion bash) \
67       --fish <($out/bin/dependabot completion fish) \
68       --zsh <($out/bin/dependabot completion zsh)
69   '';
71   checkFlags = [
72     "-skip=TestDependabot"
73   ];
75   doInstallCheck = true;
76   installCheckPhase = ''
77     $out/bin/dependabot --help
78   '';
80   passthru.withDockerImages = symlinkJoin {
81     name = "dependabot-cli-with-docker-images";
82     paths = [ dependabot-cli ];
83     buildInputs = [ makeWrapper ];
84     postBuild = ''
85       # Create a wrapper that pins the docker images that are depended upon
86       wrapProgram $out/bin/dependabot \
87         --run "docker load --input ${updateJobProxy} >&2" \
88         --add-flags "--proxy-image=dependabot-update-job-proxy:${tag}" \
89         --run "docker load --input ${updaterGitHubActions} >&2" \
90         --add-flags "--updater-image=dependabot-updater-github-actions:${tag}"
91     '';
92   };
94   passthru.tests.version = testers.testVersion {
95     package = dependabot-cli;
96     command = "dependabot --version";
97     version = "v${version}";
98   };
100   meta = with lib; {
101     changelog = "https://github.com/dependabot/cli/releases/tag/v${version}";
102     description = "Tool for testing and debugging Dependabot update jobs";
103     mainProgram = "dependabot";
104     homepage = "https://github.com/dependabot/cli";
105     license = licenses.mit;
106     maintainers = with maintainers; [
107       l0b0
108       infinisil
109     ];
110   };