2023-03-04 12:14:45 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, okteto }:
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "okteto";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "2.13.0";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "okteto";
|
|
|
|
repo = "okteto";
|
|
|
|
rev = version;
|
2023-03-04 12:14:45 +00:00
|
|
|
hash = "sha256-0fgxDUCgjYzrWflsoCGe4WRy3C/NO7FmrSw/LJ/NiUE=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
vendorHash = "sha256-d5z6uuUOHUjARIiRTVJmdQ+9VBaercIcUrcgDsN1zCs=";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
'';
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = okteto;
|
|
|
|
command = "HOME=$(mktemp -d) okteto version";
|
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Develop your applications directly in your Kubernetes Cluster";
|
|
|
|
homepage = "https://okteto.com/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ aaronjheng ];
|
|
|
|
};
|
|
|
|
}
|