mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-15 09:23:37 +00:00
80 lines
2.0 KiB
Nix
80 lines
2.0 KiB
Nix
{ lib
|
|
, stdenv
|
|
, buildGoModule
|
|
, fetchFromGitHub
|
|
, fetchzip
|
|
, installShellFiles
|
|
}:
|
|
|
|
let
|
|
version = "2.2.3";
|
|
sha256 = "12rrai56hl86213lsi8i4qrah0v7a36nks38g5373imyl9g497ym";
|
|
manifestsSha256 = "1hmzmzijpx49hh2ykv7vw3jp02dxr4qn3r1dma56g7b4nbk7aa8x";
|
|
|
|
manifests = fetchzip {
|
|
url =
|
|
"https://github.com/fluxcd/flux2/releases/download/v${version}/manifests.tar.gz";
|
|
sha256 = manifestsSha256;
|
|
stripRoot = false;
|
|
};
|
|
|
|
in buildGoModule rec {
|
|
pname = "fluxcd";
|
|
inherit version;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "fluxcd";
|
|
repo = "flux2";
|
|
rev = "v${version}";
|
|
inherit sha256;
|
|
};
|
|
|
|
vendorHash = "sha256-UPX5V3VwpX/eDy9ktqpvYb0JOzKRHH2nIQZzZ0jrYoQ=";
|
|
|
|
postUnpack = ''
|
|
cp -r ${manifests} source/cmd/flux/manifests
|
|
|
|
# disable tests that require network access
|
|
rm source/cmd/flux/create_secret_git_test.go
|
|
'';
|
|
|
|
ldflags = [ "-s" "-w" "-X main.VERSION=${version}" ];
|
|
|
|
subPackages = [ "cmd/flux" ];
|
|
|
|
# Required to workaround test error:
|
|
# panic: mkdir /homeless-shelter: permission denied
|
|
HOME = "$TMPDIR";
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
doInstallCheck = true;
|
|
installCheckPhase = ''
|
|
$out/bin/flux --version | grep ${version} > /dev/null
|
|
'';
|
|
|
|
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
|
for shell in bash fish zsh; do
|
|
$out/bin/flux completion $shell > flux.$shell
|
|
installShellCompletion flux.$shell
|
|
done
|
|
'';
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
meta = with lib; {
|
|
description =
|
|
"Open and extensible continuous delivery solution for Kubernetes";
|
|
longDescription = ''
|
|
Flux is a tool for keeping Kubernetes clusters in sync
|
|
with sources of configuration (like Git repositories), and automating
|
|
updates to configuration when there is new code to deploy.
|
|
'';
|
|
homepage = "https://fluxcd.io";
|
|
downloadPage = "https://github.com/fluxcd/flux2/releases/tag/v${version}";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ bryanasdev000 jlesquembre ];
|
|
mainProgram = "flux";
|
|
};
|
|
}
|