3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/cluster/argocd/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

64 lines
1.9 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
2020-02-13 20:12:29 +00:00
buildGoModule rec {
pname = "argocd";
2022-08-12 05:55:16 +01:00
version = "2.4.9";
2020-02-13 20:12:29 +00:00
src = fetchFromGitHub {
owner = "argoproj";
repo = "argo-cd";
rev = "v${version}";
2022-08-12 05:55:16 +01:00
sha256 = "sha256-/g+icvpo62iV9GmpYxwHP7bsJF770bfnsVknVHEnEzM=";
2020-02-13 20:12:29 +00:00
};
2022-08-12 05:55:16 +01:00
vendorSha256 = "sha256-M1ZYooS22bntHXAMK4QpMAwuMvN4/tHtVu3WZW9V8TA=";
2020-02-13 20:12:29 +00:00
# Set target as ./cmd per cli-local
# https://github.com/argoproj/argo-cd/blob/master/Makefile#L227
subPackages = [ "cmd" ];
2021-04-27 23:27:02 +01:00
2021-08-26 07:45:51 +01:00
ldflags =
2021-04-27 23:27:02 +01:00
let package_url = "github.com/argoproj/argo-cd/v2/common"; in
[
2021-08-26 07:45:51 +01:00
"-s" "-w"
2021-04-27 23:27:02 +01:00
"-X ${package_url}.version=${version}"
"-X ${package_url}.buildDate=unknown"
"-X ${package_url}.gitCommit=${src.rev}"
"-X ${package_url}.gitTag=${src.rev}"
2021-04-27 23:27:02 +01:00
"-X ${package_url}.gitTreeState=clean"
"-X ${package_url}.kubectlVersion=v0.23.1"
# NOTE: Update kubectlVersion when upgrading this package with
# https://github.com/argoproj/argo-cd/blob/v${version}/go.mod#L95
# Per https://github.com/argoproj/argo-cd/blob/master/Makefile#L18
# Will need a way to automate it :P
2021-04-27 23:27:02 +01:00
];
nativeBuildInputs = [ installShellFiles ];
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
'';
doInstallCheck = true;
installCheckPhase = ''
$out/bin/argocd version --client | grep ${src.rev} > /dev/null
'';
2021-04-27 23:27:02 +01: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
'';
meta = with lib; {
2021-06-24 01:29:12 +01:00
description = "Declarative continuous deployment for Kubernetes";
downloadPage = "https://github.com/argoproj/argo-cd";
2021-08-22 14:36:38 +01:00
homepage = "https://argo-cd.readthedocs.io/en/stable/";
2020-02-13 20:12:29 +00:00
license = licenses.asl20;
2021-11-12 02:06:04 +00:00
maintainers = with maintainers; [ shahrukh330 bryanasdev000 ];
2020-02-13 20:12:29 +00:00
};
}