2021-03-18 22:45:03 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, fetchzip, installShellFiles }:
|
|
|
|
|
|
|
|
let
|
2021-10-19 21:02:58 +00:00
|
|
|
version = "0.18.3";
|
|
|
|
sha256 = "0nvvjc0ml1irn7vxyq4m43qimp128cx8hczk21y5m39i2rg4yzx4";
|
|
|
|
manifestsSha256 = "1qgw9ij0b85vvdx03wmbbwanhq1hf69wphy58lsqwf33rdq0bb1m";
|
2021-03-18 22:45:03 +00:00
|
|
|
|
|
|
|
manifests = fetchzip {
|
|
|
|
url = "https://github.com/fluxcd/flux2/releases/download/v${version}/manifests.tar.gz";
|
2021-09-22 20:12:52 +00:00
|
|
|
sha256 = manifestsSha256;
|
2021-03-18 22:45:03 +00:00
|
|
|
stripRoot = false;
|
|
|
|
};
|
|
|
|
in
|
2020-12-09 19:45:35 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "fluxcd";
|
2021-09-22 20:12:52 +00:00
|
|
|
inherit version;
|
2020-12-09 19:45:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fluxcd";
|
|
|
|
repo = "flux2";
|
|
|
|
rev = "v${version}";
|
2021-09-22 20:12:52 +00:00
|
|
|
inherit sha256;
|
2020-12-09 19:45:35 +00:00
|
|
|
};
|
|
|
|
|
2021-10-19 21:02:58 +00:00
|
|
|
vendorSha256 = "0vgi5cnvmc98xa2ibpgvvqlc90hf3gj3v17yqncid596ig3dnqsc";
|
2020-12-09 19:45:35 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
subPackages = [ "cmd/flux" ];
|
|
|
|
|
2021-08-26 06:45:51 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X main.VERSION=${version}" ];
|
2020-12-09 19:45:35 +00:00
|
|
|
|
2021-03-18 22:45:03 +00:00
|
|
|
postUnpack = ''
|
|
|
|
cp -r ${manifests} source/cmd/flux/manifests
|
|
|
|
'';
|
|
|
|
|
2021-08-27 12:28:40 +00:00
|
|
|
# Required to workaround test error:
|
|
|
|
# panic: mkdir /homeless-shelter: permission denied
|
|
|
|
HOME="$TMPDIR";
|
|
|
|
|
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 20:12:52 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|