2021-03-18 22:45:03 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, fetchzip, installShellFiles }:
|
|
|
|
|
|
|
|
let
|
2022-06-30 03:56:11 +01:00
|
|
|
version = "0.31.3";
|
|
|
|
sha256 = "16c6rr0hzlzlfc5xsphp23s3rxavkgfcsblzm15wzd85c2ahm81l";
|
|
|
|
manifestsSha256 = "1nr44h5sy97ki2vn2426i2idnnc4pv1n3j6n4p11mf73dy9qzgzp";
|
2021-03-18 22:45:03 +00:00
|
|
|
|
|
|
|
manifests = fetchzip {
|
2021-12-07 12:55:20 +00:00
|
|
|
url =
|
|
|
|
"https://github.com/fluxcd/flux2/releases/download/v${version}/manifests.tar.gz";
|
2021-09-22 21:12:52 +01:00
|
|
|
sha256 = manifestsSha256;
|
2021-03-18 22:45:03 +00:00
|
|
|
stripRoot = false;
|
|
|
|
};
|
2020-12-09 19:45:35 +00:00
|
|
|
|
2021-12-07 12:55:20 +00:00
|
|
|
in buildGoModule rec {
|
2020-12-09 19:45:35 +00:00
|
|
|
pname = "fluxcd";
|
2021-09-22 21:12:52 +01:00
|
|
|
inherit version;
|
2020-12-09 19:45:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fluxcd";
|
|
|
|
repo = "flux2";
|
|
|
|
rev = "v${version}";
|
2021-09-22 21:12:52 +01:00
|
|
|
inherit sha256;
|
2020-12-09 19:45:35 +00:00
|
|
|
};
|
|
|
|
|
2022-06-30 03:56:11 +01:00
|
|
|
vendorSha256 = "sha256-vHRk6oADEvDmYCeBK/puGSMd4L9K1x/CVPtuYZY9klk=";
|
2020-12-09 19:45:35 +00:00
|
|
|
|
2021-10-23 13:37:32 +01:00
|
|
|
postUnpack = ''
|
|
|
|
cp -r ${manifests} source/cmd/flux/manifests
|
|
|
|
'';
|
2020-12-09 19:45:35 +00:00
|
|
|
|
2021-12-07 12:55:20 +00:00
|
|
|
patches = [ ./patches/disable-tests-ssh_key.patch ];
|
2020-12-09 19:45:35 +00:00
|
|
|
|
2021-08-26 07:45:51 +01:00
|
|
|
ldflags = [ "-s" "-w" "-X main.VERSION=${version}" ];
|
2020-12-09 19:45:35 +00:00
|
|
|
|
2021-10-23 13:37:32 +01:00
|
|
|
subPackages = [ "cmd/flux" ];
|
2021-03-18 22:45:03 +00:00
|
|
|
|
2021-08-27 13:28:40 +01:00
|
|
|
# Required to workaround test error:
|
|
|
|
# panic: mkdir /homeless-shelter: permission denied
|
2021-12-07 12:55:20 +00:00
|
|
|
HOME = "$TMPDIR";
|
2021-08-27 13:28:40 +01:00
|
|
|
|
2021-10-23 13:37:32 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-01-27 15:09:39 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/flux --version | grep ${version} > /dev/null
|
|
|
|
'';
|
|
|
|
|
2020-12-09 19:45:35 +00:00
|
|
|
postInstall = ''
|
|
|
|
for shell in bash fish zsh; do
|
|
|
|
$out/bin/flux completion $shell > flux.$shell
|
|
|
|
installShellCompletion flux.$shell
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-09-22 21:12:52 +01:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2021-12-07 12:55:20 +00:00
|
|
|
description =
|
|
|
|
"Open and extensible continuous delivery solution for Kubernetes";
|
2020-12-09 19:45:35 +00:00
|
|
|
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";
|
|
|
|
license = licenses.asl20;
|
2022-05-04 08:53:22 +01:00
|
|
|
maintainers = with maintainers; [ bryanasdev000 jlesquembre superherointj ];
|
2022-05-05 01:46:39 +01:00
|
|
|
mainProgram = "flux";
|
2020-12-09 19:45:35 +00:00
|
|
|
};
|
|
|
|
}
|