nixpkgs-suyu/pkgs/applications/networking/cluster/argocd/default.nix

75 lines
2.1 KiB
Nix
Raw Normal View History

2021-04-28 00:27:02 +02:00
{ lib, buildGoModule, fetchFromGitHub, packr, makeWrapper, installShellFiles, helm, kustomize }:
2020-02-13 21:12:29 +01:00
buildGoModule rec {
pname = "argocd";
2021-09-14 10:18:19 +02:00
version = "2.1.2";
commit = "7af9dfb3524c13e941ab604e36e49a617fe47d2e";
2021-04-28 00:27:02 +02:00
tag = "v${version}";
2020-02-13 21:12:29 +01:00
src = fetchFromGitHub {
owner = "argoproj";
repo = "argo-cd";
2021-04-28 00:27:02 +02:00
rev = tag;
2021-09-14 10:18:19 +02:00
sha256 = "1pr48z1qhv7xxnllr00zz2v0ygxmq2hjdyk0j3zazflnqr2mc596";
2020-02-13 21:12:29 +01:00
};
2021-09-14 10:18:19 +02:00
vendorSha256 = "sha256-N45yRlBGZ/c9ve2YPcWA26pylV8hzxjPh6evKtkgnoc=";
2020-02-13 21:12:29 +01:00
2021-04-28 00:27:02 +02:00
nativeBuildInputs = [ packr makeWrapper installShellFiles ];
# run packr to embed assets
preBuild = ''
packr
'';
2021-08-26 08:45:51 +02:00
ldflags =
2021-04-28 00:27:02 +02:00
let package_url = "github.com/argoproj/argo-cd/v2/common"; in
[
2021-08-26 08:45:51 +02:00
"-s" "-w"
2021-04-28 00:27:02 +02:00
"-X ${package_url}.version=${version}"
"-X ${package_url}.buildDate=unknown"
"-X ${package_url}.gitCommit=${commit}"
"-X ${package_url}.gitTag=${tag}"
"-X ${package_url}.gitTreeState=clean"
];
# Test is disabled because ksonnet is missing from nixpkgs.
# Log: https://gist.github.com/superherointj/79cbdc869dfd44d28a10dc6746ecb3f9
doCheck = false;
2021-04-28 00:27:02 +02:00
checkInputs = [
helm
kustomize
#ksonnet
];
2021-04-28 00:27:02 +02:00
doInstallCheck = true;
installCheckPhase = ''
$out/bin/argocd version --client | grep ${tag} > /dev/null
2021-08-26 03:01:40 +02:00
$out/bin/argocd-util version --client | grep ${tag} > /dev/null
2021-04-28 00:27:02 +02:00
'';
2020-02-13 21:12:29 +01:00
2021-04-28 00:27:02 +02:00
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -Dm755 "$GOPATH/bin/cmd" -T $out/bin/argocd
runHook postInstall
2020-02-20 02:48:39 +01:00
'';
2021-04-28 00:27:02 +02:00
postInstall = ''
for appname in argocd-util argocd-server argocd-repo-server argocd-application-controller argocd-dex ; do
makeWrapper $out/bin/argocd $out/bin/$appname --set ARGOCD_BINARY_NAME $appname
done
installShellCompletion --cmd argocd \
--bash <($out/bin/argocd completion bash) \
--zsh <($out/bin/argocd completion zsh)
2020-02-13 21:12:29 +01:00
'';
meta = with lib; {
2021-06-24 02:29:12 +02:00
description = "Declarative continuous deployment for Kubernetes";
downloadPage = "https://github.com/argoproj/argo-cd";
2021-08-22 15:36:38 +02:00
homepage = "https://argo-cd.readthedocs.io/en/stable/";
2020-02-13 21:12:29 +01:00
license = licenses.asl20;
2021-04-28 00:27:02 +02:00
maintainers = with maintainers; [ shahrukh330 superherointj ];
2020-02-13 21:12:29 +01:00
};
}