diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2024-06-19 18:00:54 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-19 18:00:54 +0000 |
commit | 11b7fc6440a32a6e33076665d3a020588bf7cdd4 (patch) | |
tree | 9b420268ccc1ab36a106fa6173b93b6b39f37cda /pkgs/by-name/we | |
parent | e16308b7973a83c9f7d61667cf8eab632c6946de (diff) | |
parent | a9c4ba3169e3e812913af74f740007f21b1eb7af (diff) |
Merge master into staging-next
Diffstat (limited to 'pkgs/by-name/we')
-rw-r--r-- | pkgs/by-name/we/werf/package.nix | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/pkgs/by-name/we/werf/package.nix b/pkgs/by-name/we/werf/package.nix new file mode 100644 index 0000000000000..0e9e45603f70f --- /dev/null +++ b/pkgs/by-name/we/werf/package.nix @@ -0,0 +1,105 @@ +{ + lib, + stdenv, + buildGoModule, + fetchFromGitHub, + installShellFiles, + btrfs-progs, + testers, + werf, +}: + +buildGoModule rec { + pname = "werf"; + version = "2.6.1"; + + src = fetchFromGitHub { + owner = "werf"; + repo = "werf"; + rev = "v${version}"; + hash = "sha256-10RyCVF1w5xj/qhFXQTlyrt9HG/4di2fUwUtDHU6t44="; + }; + + vendorHash = "sha256-d1Dn+JN8tiBVx7YDbtvLW0YgIW2ENrEdx4gKatYy1hw="; + + proxyVendor = true; + + subPackages = [ "cmd/werf" ]; + + nativeBuildInputs = [ installShellFiles ]; + + buildInputs = + lib.optionals stdenv.isLinux [ btrfs-progs ] + ++ lib.optionals stdenv.hostPlatform.isGnu [ stdenv.cc.libc.static ]; + + CGO_ENABLED = if stdenv.isLinux then 1 else 0; + + ldflags = + [ + "-s" + "-w" + "-X github.com/werf/werf/v2/pkg/werf.Version=v${version}" + ] + ++ lib.optionals (CGO_ENABLED == 1) [ + "-extldflags=-static" + "-linkmode external" + ]; + + tags = + [ + "containers_image_openpgp" + "dfrunmount" + "dfrunnetwork" + "dfrunsecurity" + "dfssh" + ] + ++ lib.optionals (CGO_ENABLED == 1) [ + "cni" + "exclude_graphdriver_devicemapper" + "netgo" + "no_devmapper" + "osusergo" + "static_build" + ]; + + preCheck = + '' + # Test all targets. + unset subPackages + + # Remove tests that require external services. + rm -rf \ + integration/suites \ + pkg/true_git/*test.go \ + test/e2e + '' + + lib.optionalString (CGO_ENABLED == 0) '' + # A workaround for osusergo. + export USER=nixbld + ''; + + postInstall = '' + installShellCompletion --cmd werf \ + --bash <($out/bin/werf completion --shell=bash) \ + --zsh <($out/bin/werf completion --shell=zsh) + ''; + + passthru.tests.version = testers.testVersion { + package = werf; + command = "werf version"; + version = src.rev; + }; + + meta = with lib; { + description = "GitOps delivery tool"; + mainProgram = "werf"; + longDescription = '' + The CLI tool gluing Git, Docker, Helm & Kubernetes with any CI system to + implement CI/CD and Giterminism. + ''; + homepage = "https://werf.io"; + changelog = "https://github.com/werf/werf/releases/tag/${src.rev}"; + license = licenses.asl20; + maintainers = with maintainers; [ azahi ]; + }; +} |