Merge pull request #217280 from aaronjheng/temporal-cli
This commit is contained in:
commit
15e2a701e6
1 changed files with 74 additions and 24 deletions
|
@ -1,7 +1,42 @@
|
|||
{ lib, fetchFromGitHub, buildGoModule, testers, temporal-cli }:
|
||||
{ lib, fetchFromGitHub, buildGoModule, installShellFiles, symlinkJoin }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "temporal-cli";
|
||||
let
|
||||
tctl-next = buildGoModule rec {
|
||||
pname = "tctl-next";
|
||||
version = "0.8.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "temporalio";
|
||||
repo = "cli";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-yQnFw3uYGKrTevGFVZNgkWwKCCWiGy0qwJJOmnMpTJQ=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-ld59ADHnlgsCA2mzVhdq6Vb2aa9rApvFxs3NpHiCKxo=";
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
excludedPackages = [ "./cmd/docgen" ];
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X github.com/temporalio/cli/headers.Version=${version}"
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
export HOME=$(mktemp -d)
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd temporal \
|
||||
--bash <($out/bin/temporal completion bash) \
|
||||
--zsh <($out/bin/temporal completion zsh)
|
||||
'';
|
||||
};
|
||||
|
||||
tctl = buildGoModule rec {
|
||||
pname = "tctl";
|
||||
version = "1.18.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
|
@ -13,23 +48,38 @@ buildGoModule rec {
|
|||
|
||||
vendorHash = "sha256-BUYEeC5zli++OxVFgECJGqJkbDwglLppSxgo+4AqOb0=";
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
excludedPackages = [ "./cmd/copyright" ];
|
||||
|
||||
ldflags = [ "-s" "-w" ];
|
||||
|
||||
preCheck = ''
|
||||
export HOME=$(mktemp -d)
|
||||
'';
|
||||
|
||||
passthru.tests.version = testers.testVersion {
|
||||
package = temporal-cli;
|
||||
# the app writes a default config file at startup
|
||||
command = "HOME=$(mktemp -d) ${meta.mainProgram} --version";
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd tctl \
|
||||
--bash <($out/bin/tctl completion bash) \
|
||||
--zsh <($out/bin/tctl completion zsh)
|
||||
'';
|
||||
};
|
||||
in
|
||||
symlinkJoin rec {
|
||||
pname = "temporal-cli";
|
||||
inherit (tctl) version;
|
||||
name = "${pname}-${version}";
|
||||
|
||||
paths = [
|
||||
tctl-next
|
||||
tctl
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Temporal CLI";
|
||||
homepage = "https://temporal.io";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ aaronjheng ];
|
||||
mainProgram = "tctl";
|
||||
mainProgram = "temporal";
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue