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";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "2.31.0";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "okteto";
|
|
|
|
repo = "okteto";
|
|
|
|
rev = version;
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-YY8PWBEd8MV/k0wvXqyFTuNi3mvUnFNm2GrmrFF7TKQ=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
vendorHash = "sha256-7XZImCS9hv8ILYfGcoY3tMk0grswWbfpQrBKhghTfsY=";
|
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 ];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
excludedPackages = [ "integration" "samples" ];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/okteto/okteto/pkg/config.VersionString=${version}"
|
|
|
|
];
|
|
|
|
|
|
|
|
tags = [ "osusergo" "netgo" "static_build" ];
|
|
|
|
|
|
|
|
preCheck = ''
|
2024-06-05 15:53:02 +00:00
|
|
|
export HOME="$(mktemp -d)"
|
2022-06-16 17:23:12 +00:00
|
|
|
'';
|
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
checkFlags =
|
|
|
|
let
|
|
|
|
skippedTests = [
|
|
|
|
# require network access
|
|
|
|
"TestCreateDockerfile"
|
|
|
|
|
|
|
|
# access file system
|
|
|
|
"Test_translateDeployment"
|
|
|
|
"Test_translateStatefulSet"
|
|
|
|
"Test_translateJobWithoutVolumes"
|
|
|
|
"Test_translateJobWithVolumes"
|
|
|
|
"Test_translateService"
|
|
|
|
];
|
|
|
|
in
|
|
|
|
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
|
2024-05-15 15:35:15 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
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;
|
2024-06-05 15:53:02 +00:00
|
|
|
command = "HOME=\"$(mktemp -d)\" okteto version";
|
2023-03-04 12:14:45 +00:00
|
|
|
};
|
|
|
|
|
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 ];
|
2024-05-15 15:35:15 +00:00
|
|
|
mainProgram = "okteto";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
}
|