2021-03-18 22:45:03 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, fetchzip, installShellFiles }:
|
|
|
|
|
|
|
|
let
|
2021-08-07 07:43:27 +00:00
|
|
|
version = "0.16.2";
|
2021-03-18 22:45:03 +00:00
|
|
|
|
|
|
|
manifests = fetchzip {
|
|
|
|
url = "https://github.com/fluxcd/flux2/releases/download/v${version}/manifests.tar.gz";
|
2021-08-24 19:11:37 +00:00
|
|
|
sha256 = "05khmpbv42wjpkdb4n51pnq678la6hjfhkyy49d0j2kcnvfd1m5p";
|
2021-03-18 22:45:03 +00:00
|
|
|
stripRoot = false;
|
|
|
|
};
|
|
|
|
in
|
2020-12-09 19:45:35 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
2021-03-18 22:45:03 +00:00
|
|
|
inherit version;
|
|
|
|
|
2020-12-09 19:45:35 +00:00
|
|
|
pname = "fluxcd";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fluxcd";
|
|
|
|
repo = "flux2";
|
|
|
|
rev = "v${version}";
|
2021-08-07 07:43:27 +00:00
|
|
|
sha256 = "sha256-hP2HQI9Oc7IlzVS5r7yqGAgSgqECOSZVe2B3vO2sgKA=";
|
2020-12-09 19:45:35 +00:00
|
|
|
};
|
|
|
|
|
2021-08-07 07:43:27 +00:00
|
|
|
vendorSha256 = "sha256-6ABnX0GV3HmhpUpPWS0bigubRqpXGoikEeQ/LqO6Ybs=";
|
2020-12-09 19:45:35 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
subPackages = [ "cmd/flux" ];
|
|
|
|
|
|
|
|
buildFlagsArray = [ "-ldflags=-s -w -X main.VERSION=${version}" ];
|
|
|
|
|
2021-03-18 22:45:03 +00:00
|
|
|
postUnpack = ''
|
|
|
|
cp -r ${manifests} source/cmd/flux/manifests
|
|
|
|
'';
|
|
|
|
|
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-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-12-09 19:45:35 +00:00
|
|
|
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";
|
|
|
|
license = licenses.asl20;
|
2021-08-24 19:11:37 +00:00
|
|
|
maintainers = with maintainers; [ jlesquembre superherointj ];
|
2020-12-09 19:45:35 +00:00
|
|
|
};
|
|
|
|
}
|