2022-03-18 21:01:43 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2020-02-13 20:12:29 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "argocd";
|
2024-03-02 04:21:40 +00:00
|
|
|
version = "2.10.2";
|
2020-02-13 20:12:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "argoproj";
|
|
|
|
repo = "argo-cd";
|
2022-04-06 06:23:51 +00:00
|
|
|
rev = "v${version}";
|
2024-03-02 04:21:40 +00:00
|
|
|
hash = "sha256-eFa2AXFVymi7et+fHTLgdiBUq6D8zK5DRg9Dqhxe4TE=";
|
2020-02-13 20:12:29 +00:00
|
|
|
};
|
|
|
|
|
2022-11-13 23:14:45 +00:00
|
|
|
proxyVendor = true; # darwin/linux hash mismatch
|
2024-03-02 04:21:40 +00:00
|
|
|
vendorHash = "sha256-O13zMtrXgW3SiJmAn64/QW/CJN0+d0h0MMyEWKsy9WE=";
|
2020-02-13 20:12:29 +00:00
|
|
|
|
2022-05-29 03:16:28 +00:00
|
|
|
# Set target as ./cmd per cli-local
|
|
|
|
# https://github.com/argoproj/argo-cd/blob/master/Makefile#L227
|
2022-03-18 21:01:43 +00:00
|
|
|
subPackages = [ "cmd" ];
|
2021-04-27 22:27:02 +00:00
|
|
|
|
2021-08-26 06:45:51 +00:00
|
|
|
ldflags =
|
2021-04-27 22:27:02 +00:00
|
|
|
let package_url = "github.com/argoproj/argo-cd/v2/common"; in
|
|
|
|
[
|
2021-08-26 06:45:51 +00:00
|
|
|
"-s" "-w"
|
2021-04-27 22:27:02 +00:00
|
|
|
"-X ${package_url}.version=${version}"
|
|
|
|
"-X ${package_url}.buildDate=unknown"
|
2022-04-06 06:23:51 +00:00
|
|
|
"-X ${package_url}.gitCommit=${src.rev}"
|
|
|
|
"-X ${package_url}.gitTag=${src.rev}"
|
2021-04-27 22:27:02 +00:00
|
|
|
"-X ${package_url}.gitTreeState=clean"
|
2022-11-02 09:40:39 +00:00
|
|
|
"-X ${package_url}.kubectlVersion=v0.24.2"
|
2022-05-29 03:16:28 +00:00
|
|
|
# NOTE: Update kubectlVersion when upgrading this package with
|
2022-07-25 04:16:35 +00:00
|
|
|
# https://github.com/argoproj/argo-cd/blob/v${version}/go.mod#L95
|
2022-05-29 03:16:28 +00:00
|
|
|
# Per https://github.com/argoproj/argo-cd/blob/master/Makefile#L18
|
|
|
|
# Will need a way to automate it :P
|
2021-04-27 22:27:02 +00:00
|
|
|
];
|
|
|
|
|
2022-03-18 21:01:43 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2020-02-13 20:12:29 +00:00
|
|
|
|
2021-04-27 22:27:02 +00: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 03:58:04 +00:00
|
|
|
|
2022-03-18 21:01:43 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
2022-04-06 06:23:51 +00:00
|
|
|
$out/bin/argocd version --client | grep ${src.rev} > /dev/null
|
2022-03-18 21:01:43 +00:00
|
|
|
'';
|
|
|
|
|
2021-04-27 22:27:02 +00:00
|
|
|
postInstall = ''
|
|
|
|
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 03:58:04 +00:00
|
|
|
|
2020-03-27 07:33:21 +00:00
|
|
|
meta = with lib; {
|
2021-06-24 00:29:12 +00:00
|
|
|
description = "Declarative continuous deployment for Kubernetes";
|
|
|
|
downloadPage = "https://github.com/argoproj/argo-cd";
|
2021-08-22 13:36:38 +00:00
|
|
|
homepage = "https://argo-cd.readthedocs.io/en/stable/";
|
2020-02-13 20:12:29 +00:00
|
|
|
license = licenses.asl20;
|
2023-06-08 07:45:51 +00:00
|
|
|
maintainers = with maintainers; [ shahrukh330 bryanasdev000 qjoly ];
|
2020-02-13 20:12:29 +00:00
|
|
|
};
|
2020-07-31 03:58:04 +00:00
|
|
|
}
|