Unverified Commit aee33281 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

ytt: refactor (#350668)

parents dc6b1fa5 ce9f200c
Loading
Loading
Loading
Loading
+30 −8
Original line number Diff line number Diff line
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:

{
  lib,
  buildGoModule,
  fetchFromGitHub,
  installShellFiles,
  testers,
  ytt,
}:
buildGoModule rec {
  pname = "ytt";
  version = "0.50.0";

  src = fetchFromGitHub {
    owner = "vmware-tanzu";
    repo = "carvel-ytt";
    owner = "carvel-dev";
    repo = "ytt";
    rev = "v${version}";
    sha256 = "sha256-57SCBlA2IoBy0iygqunFPBS/nyLtl7e7GlA3vB+ED/4=";
  };
@@ -16,11 +22,11 @@ buildGoModule rec {
  nativeBuildInputs = [ installShellFiles ];

  ldflags = [
    "-X github.com/vmware-tanzu/carvel-ytt/pkg/version.Version=${version}"
    "-s"
    "-w"
    "-X carvel.dev/ytt/pkg/version.Version=${version}"
  ];

  subPackages = [ "cmd/ytt" ];

  postInstall = ''
    installShellCompletion --cmd ytt \
      --bash <($out/bin/ytt completion bash) \
@@ -28,11 +34,27 @@ buildGoModule rec {
      --zsh <($out/bin/ytt completion zsh)
  '';

  # Once `__structuredArgs` is introduced, integrate checks and
  # set some regexes `checkFlags = [ "-skip=TestDataValues.*" ]`
  # etc. So far we dont test because passing '*' chars through the Go builder
  # is flawed.
  doCheck = false;

  passthru.tests.version = testers.testVersion {
    package = ytt;
    command = "ytt --version";
    inherit version;
  };

  meta = with lib; {
    description = "YAML templating tool that allows configuration of complex software via reusable templates with user-provided values";
    mainProgram = "ytt";
    homepage = "https://get-ytt.io";
    license = licenses.asl20;
    maintainers = with maintainers; [ brodes techknowlogick ];
    maintainers = with maintainers; [
      brodes
      techknowlogick
      gabyx
    ];
  };
}