depot/third_party/nixpkgs/pkgs/development/tools/okteto/default.nix
Default email 9c6ee729d6 Project import generated by Copybara.
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
2023-07-15 19:15:38 +02:00

54 lines
1.3 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, okteto }:
buildGoModule rec {
pname = "okteto";
version = "2.16.5";
src = fetchFromGitHub {
owner = "okteto";
repo = "okteto";
rev = version;
hash = "sha256-K3GkdcUNaBTo5sMfLONQ2o7SYUNMJ45WA5FQQ3+0+RY=";
};
vendorHash = "sha256-aNXKRP7WFzscDPjZmDTbgKItNEQrRpsq+XiOuggx85w=";
postPatch = ''
# Disable some tests that need file system & network access.
find cmd -name "*_test.go" | xargs rm -f
rm -f pkg/analytics/track_test.go
'';
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-s"
"-w"
"-X github.com/okteto/okteto/pkg/config.VersionString=${version}"
];
tags = [ "osusergo" "netgo" "static_build" ];
preCheck = ''
export HOME=$(mktemp -d)
'';
postInstall = ''
installShellCompletion --cmd okteto \
--bash <($out/bin/okteto completion bash) \
--fish <($out/bin/okteto completion fish) \
--zsh <($out/bin/okteto completion zsh)
'';
passthru.tests.version = testers.testVersion {
package = okteto;
command = "HOME=$(mktemp -d) okteto version";
};
meta = with lib; {
description = "Develop your applications directly in your Kubernetes Cluster";
homepage = "https://okteto.com/";
license = licenses.asl20;
maintainers = with maintainers; [ aaronjheng ];
};
}