Unverified Commit 399068c5 authored by Nikolay Korotkiy's avatar Nikolay Korotkiy Committed by GitHub
Browse files

jcli: 0.0.46 -> 0.0.47 (#374325)

parents b24e122b dfb1fdf3
Loading
Loading
Loading
Loading
+16 −9
Original line number Diff line number Diff line
@@ -2,22 +2,23 @@
  lib,
  stdenv,
  buildGoModule,
  buildPackages,
  fetchFromGitHub,
  installShellFiles,
}:

buildGoModule rec {
  pname = "jcli";
  version = "0.0.46";
  version = "0.0.47";

  src = fetchFromGitHub {
    owner = "jenkins-zh";
    repo = "jenkins-cli";
    tag = "v${version}";
    hash = "sha256-l0qpyrggDJSzaJMbhgJYVK2Y3A/R+xS0Qoy3afA/eGo=";
    hash = "sha256-HsuYTgGe0cDRAG5FP77CGJG+xCDSWjBthPeAclmqd44=";
  };

  vendorHash = "sha256-0x0Cl6cqullGIvtQTlHTGnWz9dBCT7aMEIRSB/Cuy8k=";
  vendorHash = "sha256-Ld59i91k1tyR9BhlRohHiRPB8Zt3rQWMtRw+J+13TFw=";

  ldflags = [
    "-s"
@@ -30,21 +31,27 @@ buildGoModule rec {
  nativeBuildInputs = [ installShellFiles ];

  postInstall =
    let
      jcliBin =
        if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
          "$out"
        else
          lib.getBin buildPackages.jcli;
    in
    ''
      mv $out/bin/{jenkins-cli,jcli}
    ''
    + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''

      installShellCompletion --cmd jcli \
        --bash <($out/bin/jcli completion --type bash) \
        --fish <($out/bin/jcli completion --type fish) \
        --zsh <($out/bin/jcli completion --type zsh)
        --bash <(${jcliBin}/bin/jcli completion --type bash) \
        --fish <(${jcliBin}/bin/jcli completion --type fish) \
        --zsh <(${jcliBin}/bin/jcli completion --type zsh)
    '';

  meta = {
    description = "Jenkins CLI allows you to manage your Jenkins in an easy way";
    mainProgram = "jcli";
    homepage = "https://github.com/jenkins-zh/jenkins-cli";
    changelog = "https://github.com/jenkins-zh/jenkins-cli/releases/tag/${src.tag}";
    changelog = "https://github.com/jenkins-zh/jenkins-cli/releases/tag/v${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ sikmir ];
  };