2021-04-27 23:27:02 +01:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, packr, makeWrapper, installShellFiles, helm, kustomize }:
|
2020-02-13 20:12:29 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "argocd";
|
2021-04-27 23:27:02 +01:00
|
|
|
version = "2.0.1";
|
|
|
|
commit = "33eaf11e3abd8c761c726e815cbb4b6af7dcb030";
|
|
|
|
tag = "v${version}";
|
2020-02-13 20:12:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "argoproj";
|
|
|
|
repo = "argo-cd";
|
2021-04-27 23:27:02 +01:00
|
|
|
rev = tag;
|
|
|
|
sha256 = "sha256-j/RdiMeaYxlmEvo5CKrGvkp25MrFsSYh+XNYWNcs0PE=";
|
2020-02-13 20:12:29 +00:00
|
|
|
};
|
|
|
|
|
2021-04-27 23:27:02 +01:00
|
|
|
vendorSha256 = "sha256-8j5v99wOHM/SndJwpmGWiCFEyw4K513HEEbkPrD8C90=";
|
2020-02-13 20:12:29 +00:00
|
|
|
|
2021-04-27 23:27:02 +01:00
|
|
|
nativeBuildInputs = [ packr makeWrapper installShellFiles ];
|
|
|
|
|
|
|
|
# run packr to embed assets
|
|
|
|
preBuild = ''
|
|
|
|
packr
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildFlagsArray =
|
|
|
|
let package_url = "github.com/argoproj/argo-cd/v2/common"; in
|
|
|
|
[
|
|
|
|
"-ldflags="
|
|
|
|
"-s -w"
|
|
|
|
"-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
|
2020-08-04 01:26:27 +01:00
|
|
|
doCheck = false;
|
2021-04-27 23:27:02 +01:00
|
|
|
checkInputs = [
|
|
|
|
helm
|
|
|
|
kustomize
|
|
|
|
#ksonnet
|
|
|
|
];
|
2020-08-04 01:26:27 +01:00
|
|
|
|
2021-04-27 23:27:02 +01:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/argocd version --client | grep ${tag} > /dev/null
|
|
|
|
$out/bin/argocd-util version | grep ${tag} > /dev/null
|
|
|
|
'';
|
2020-02-13 20:12:29 +00:00
|
|
|
|
2021-04-27 23:27:02 +01:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin
|
|
|
|
install -Dm755 "$GOPATH/bin/cmd" -T $out/bin/argocd
|
|
|
|
runHook postInstall
|
2020-02-20 01:48:39 +00:00
|
|
|
'';
|
2020-07-31 04:58:04 +01:00
|
|
|
|
2021-04-27 23:27:02 +01: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 20:12:29 +00:00
|
|
|
'';
|
2020-07-31 04:58:04 +01:00
|
|
|
|
2020-03-27 07:33:21 +00:00
|
|
|
meta = with lib; {
|
2020-02-13 20:12:29 +00:00
|
|
|
description = "Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes";
|
|
|
|
homepage = "https://github.com/argoproj/argo";
|
|
|
|
license = licenses.asl20;
|
2021-04-27 23:27:02 +01:00
|
|
|
maintainers = with maintainers; [ shahrukh330 superherointj ];
|
2020-02-13 20:12:29 +00:00
|
|
|
};
|
2020-07-31 04:58:04 +01:00
|
|
|
}
|