summary refs log tree commit diff
diff options
context:
space:
mode:
authorAtkins Chang <atkinschang@gmail.com>2021-08-06 22:36:28 +0800
committerAtkins Chang <atkinschang@gmail.com>2021-08-07 22:38:41 +0800
commitdae92ad5e6b7fea52b2761dfa6facc925268ed35 (patch)
tree4fea65d197b161796b8b21250ecf72b3e4230d03
parentb626776ab2e9c4389e8f7717193dc15b0f337bb5 (diff)
downloadnixpkgs-dae92ad5e6b7fea52b2761dfa6facc925268ed35.tar
nixpkgs-dae92ad5e6b7fea52b2761dfa6facc925268ed35.tar.gz
nixpkgs-dae92ad5e6b7fea52b2761dfa6facc925268ed35.tar.bz2
nixpkgs-dae92ad5e6b7fea52b2761dfa6facc925268ed35.tar.lz
nixpkgs-dae92ad5e6b7fea52b2761dfa6facc925268ed35.tar.xz
nixpkgs-dae92ad5e6b7fea52b2761dfa6facc925268ed35.tar.zst
nixpkgs-dae92ad5e6b7fea52b2761dfa6facc925268ed35.zip
chart-testing: init at 3.4.0
Signed-off-by: Atkins Chang <atkinschang@gmail.com>
-rw-r--r--pkgs/applications/networking/cluster/helm/chart-testing/default.nix40
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/applications/networking/cluster/helm/chart-testing/default.nix b/pkgs/applications/networking/cluster/helm/chart-testing/default.nix
new file mode 100644
index 00000000000..c4365975713
--- /dev/null
+++ b/pkgs/applications/networking/cluster/helm/chart-testing/default.nix
@@ -0,0 +1,40 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "chart-testing";
+  version = "3.4.0";
+
+  src = fetchFromGitHub {
+    owner = "helm";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-c7Rjk2YZaQXyFwrDVwYgOCnq/F2ooIUVETXVn5FVlZE=";
+  };
+
+  vendorSha256 = "sha256-1Py66ljDjJC38biJ25D8KnWEi3nXAVt9QSgyH1KkwHM=";
+
+  postPatch = ''
+    substituteInPlace pkg/config/config.go \
+      --replace "\"/etc/ct\"," "\"$out/etc/ct\","
+  '';
+
+  ldflags = [
+    "-w"
+    "-s"
+    "-X github.com/helm/chart-testing/v3/ct/cmd.Version=${version}"
+    "-X github.com/helm/chart-testing/v3/ct/cmd.GitCommit=${src.rev}"
+    "-X github.com/helm/chart-testing/v3/ct/cmd.BuildDate=19700101-00:00:00"
+  ];
+
+  postInstall = ''
+    install -Dm644 -t $out/etc/ct etc/chart_schema.yaml
+    install -Dm644 -t $out/etc/ct etc/lintconf.yaml
+  '';
+
+  meta = with lib; {
+    description = "A tool for testing Helm charts";
+    homepage = "https://github.com/helm/chart-testing";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ atkinschang ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 204f3c8b6ef..8c0289fb1e0 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -25503,6 +25503,8 @@ in
 
   kubernetes-helmPlugins = dontRecurseIntoAttrs (callPackage ../applications/networking/cluster/helm/plugins { });
 
+  chart-testing = callPackage ../applications/networking/cluster/helm/chart-testing { };
+
   kubetail = callPackage ../applications/networking/cluster/kubetail { } ;
 
   kupfer = callPackage ../applications/misc/kupfer {