Files
nixpkgs/pkgs/by-name/ok/okteto/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

89 lines
2.0 KiB
Nix

{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
testers,
}:
buildGoModule (finalAttrs: {
pname = "okteto";
version = "3.12.0";
src = fetchFromGitHub {
owner = "okteto";
repo = "okteto";
tag = finalAttrs.version;
hash = "sha256-EL1xWrxI7W2iXb0syb/53BgW22kqOSJCHyzBHGdQOm4=";
};
vendorHash = "sha256-wkuCUMzmYAWf8RjM6DkTTHaY7qEIjGNYiT4grtCbYs8=";
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 ];
excludedPackages = [
"integration"
"samples"
];
ldflags = [
"-s"
"-w"
"-X github.com/okteto/okteto/pkg/config.VersionString=${finalAttrs.version}"
];
tags = [
"osusergo"
"netgo"
"static_build"
];
preCheck = ''
export HOME="$(mktemp -d)"
'';
checkFlags =
let
skippedTests = [
# require network access
"TestCreateDockerfile"
# access file system
"Test_translateDeployment"
"Test_translateStatefulSet"
"Test_translateJobWithoutVolumes"
"Test_translateJobWithVolumes"
"Test_translateService"
"TestProtobufTranslator_Translate_Success"
];
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
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 = finalAttrs.finalPackage;
command = "HOME=\"$(mktemp -d)\" okteto version";
};
meta = {
description = "Develop your applications directly in your Kubernetes Cluster";
homepage = "https://okteto.com/";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ aaronjheng ];
mainProgram = "okteto";
};
})