mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-22 13:43:22 +00:00
6c21273e1e
change commit and tag to src.rev no more manual update
59 lines
1.6 KiB
Nix
59 lines
1.6 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
buildGoModule rec {
|
|
pname = "argocd";
|
|
version = "2.3.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "argoproj";
|
|
repo = "argo-cd";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-ChgWqhkzVKhbyEA+g2flWK/WMxur7UHWXJUcLzp9RTE=";
|
|
};
|
|
|
|
vendorSha256 = "sha256-XrIIMnn65Y10KnVTsmw6vLE53Zra1lWNFgklmaj3gF8=";
|
|
|
|
# Set target as ./cmd per release-cli
|
|
# https://github.com/argoproj/argo-cd/blob/master/Makefile#L222
|
|
subPackages = [ "cmd" ];
|
|
|
|
ldflags =
|
|
let package_url = "github.com/argoproj/argo-cd/v2/common"; in
|
|
[
|
|
"-s" "-w"
|
|
"-X ${package_url}.version=${version}"
|
|
"-X ${package_url}.buildDate=unknown"
|
|
"-X ${package_url}.gitCommit=${src.rev}"
|
|
"-X ${package_url}.gitTag=${src.rev}"
|
|
"-X ${package_url}.gitTreeState=clean"
|
|
];
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
mkdir -p $out/bin
|
|
install -Dm755 "$GOPATH/bin/cmd" -T $out/bin/argocd
|
|
runHook postInstall
|
|
'';
|
|
|
|
doInstallCheck = true;
|
|
installCheckPhase = ''
|
|
$out/bin/argocd version --client | grep ${src.rev} > /dev/null
|
|
'';
|
|
|
|
postInstall = ''
|
|
installShellCompletion --cmd argocd \
|
|
--bash <($out/bin/argocd completion bash) \
|
|
--zsh <($out/bin/argocd completion zsh)
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Declarative continuous deployment for Kubernetes";
|
|
downloadPage = "https://github.com/argoproj/argo-cd";
|
|
homepage = "https://argo-cd.readthedocs.io/en/stable/";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ shahrukh330 bryanasdev000 ];
|
|
};
|
|
}
|