1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5}:
6
7buildGoModule rec {
8 pname = "helm-cm-push";
9 version = "0.10.4";
10
11 src = fetchFromGitHub {
12 owner = "chartmuseum";
13 repo = "helm-push";
14 rev = "v${version}";
15 hash = "sha256-YnhI1/BDk9swr3YFm5ajGf4LLgPty7blA2tlsMH0erY=";
16 };
17
18 vendorHash = "sha256-7bUDKqkvBV1Upcrj4DQnVCP74QtKlSwF0Kl2sPFZpjc=";
19
20 subPackage = [ "cmd/helm-cm-push" ];
21
22 # Remove hooks.
23 postPatch = ''
24 sed -e '/^hooks:/,+2 d' -i plugin.yaml
25 '';
26
27 env.CGO_ENABLED = 0;
28
29 ldflags = [
30 "-s"
31 "-w"
32 ];
33
34 postInstall = ''
35 install -Dm644 plugin.yaml $out/helm-cm-push/plugin.yaml
36 mv $out/bin $out/helm-cm-push
37 '';
38
39 # Tests require the ChartMuseum service.
40 doCheck = false;
41
42 meta = with lib; {
43 description = "Helm plugin to push chart package to ChartMuseum";
44 homepage = "https://github.com/chartmuseum/helm-push";
45 license = licenses.asl20;
46 maintainers = [ ];
47 };
48}