2022-07-09 13:04:11 +02:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, copilot-cli }:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "copilot-cli";
|
2022-12-01 01:43:57 +01:00
|
|
|
version = "1.24.0";
|
2022-07-09 13:04:11 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aws";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-12-01 01:43:57 +01:00
|
|
|
sha256 = "sha256-OTt9sJuLv+fY2OTK4FGl15/YmxnPRqGXNnKYl9TtHxE=";
|
2022-07-09 13:04:11 +02:00
|
|
|
};
|
|
|
|
|
2022-12-01 01:43:57 +01:00
|
|
|
vendorSha256 = "sha256-dH39ZpATq5Oafr7Guc+zYUhjlAgiwpc5HKHWlMm4buU=";
|
2022-07-09 13:04:11 +02:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
# follow LINKER_FLAGS in Makefile
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/aws/copilot-cli/internal/pkg/version.Version=${version}"
|
|
|
|
"-X github.com/aws/copilot-cli/internal/pkg/cli.binaryS3BucketPath=https://ecs-cli-v2-release.s3.amazonaws.com"
|
|
|
|
];
|
|
|
|
|
|
|
|
subPackages = [ "./cmd/copilot" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd copilot \
|
|
|
|
--bash <($out/bin/copilot completion bash) \
|
|
|
|
--fish <($out/bin/copilot completion fish) \
|
|
|
|
--zsh <($out/bin/copilot completion zsh)
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = copilot-cli;
|
|
|
|
command = "copilot version";
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Build, Release and Operate Containerized Applications on AWS.";
|
|
|
|
homepage = "https://github.com/aws/copilot-cli";
|
|
|
|
changelog = "https://github.com/aws/copilot-cli/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ jiegec ];
|
|
|
|
};
|
|
|
|
}
|