2023-03-24 00:07:29 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "scalr-cli";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "0.16.0";
|
2023-03-24 00:07:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Scalr";
|
|
|
|
repo = "scalr-cli";
|
|
|
|
rev = "v${version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-9osB3bsc8IvH1ishG9uiIUnAwC1yZd0rFhiZdzYucI8=";
|
2023-03-24 00:07:29 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
vendorHash = "sha256-0p4f+KKD04IFAUQG8F3b+2sx9suYemt3wbgSNNOOIlk=";
|
2023-03-24 00:07:29 +00:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s" "-w"
|
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
# Set the version.
|
|
|
|
substituteInPlace main.go --replace '"0.0.0"' '"${version}"'
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin/cli $out/bin/scalr
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = false; # Skip tests as they require creating actual Scalr resources.
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Command-line tool that communicates directly with the Scalr API";
|
2023-03-24 00:07:29 +00:00
|
|
|
homepage = "https://github.com/Scalr/scalr-cli";
|
|
|
|
changelog = "https://github.com/Scalr/scalr-cli/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ dylanmtaylor ];
|
|
|
|
mainProgram = "scalr";
|
|
|
|
};
|
|
|
|
}
|