2020-06-26 03:01:51 +00:00
|
|
|
{ lib, buildGoModule, buildGoPackage, fetchFromGitHub, installShellFiles }:
|
2019-01-26 00:43:58 +00:00
|
|
|
|
2020-02-29 01:47:25 +00:00
|
|
|
let
|
|
|
|
# Argo can package a static server in the CLI using the `staticfiles` go module.
|
|
|
|
# We build the CLI without the static server for simplicity, but the tool is still required for
|
|
|
|
# compilation to succeed.
|
|
|
|
# See: https://github.com/argoproj/argo/blob/d7690e32faf2ac5842468831daf1443283703c25/Makefile#L117
|
|
|
|
staticfiles = buildGoPackage rec {
|
|
|
|
name = "staticfiles";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bouk";
|
|
|
|
repo = "staticfiles";
|
|
|
|
rev = "827d7f6389cd410d0aa3f3d472a4838557bf53dd";
|
|
|
|
sha256 = "0xarhmsqypl8036w96ssdzjv3k098p2d4mkmw5f6hkp1m3j67j61";
|
|
|
|
};
|
|
|
|
|
|
|
|
goPackagePath = "bou.ke/staticfiles";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
buildGoModule rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "argo";
|
2020-11-10 21:27:53 +00:00
|
|
|
version = "2.11.7";
|
2019-01-26 00:43:58 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "argoproj";
|
|
|
|
repo = "argo";
|
|
|
|
rev = "v${version}";
|
2020-11-10 21:27:53 +00:00
|
|
|
sha256 = "1i7qgghnb39bibnk07f47k64qpkb1k8mi3bbfnx6mxl0jlq335af";
|
2019-01-26 00:43:58 +00:00
|
|
|
};
|
|
|
|
|
2020-10-17 16:04:50 +00:00
|
|
|
vendorSha256 = "1ca0ssvbi4vrsn9ljc783hnh9bmf5p8nr1lz5wm8g3gbrrrf1ray";
|
2020-02-29 01:47:25 +00:00
|
|
|
|
2020-08-04 00:26:27 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2019-10-13 00:12:59 +00:00
|
|
|
subPackages = [ "cmd/argo" ];
|
2019-01-26 00:43:58 +00:00
|
|
|
|
2020-06-26 03:01:51 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2020-02-29 01:47:25 +00:00
|
|
|
preBuild = ''
|
|
|
|
mkdir -p ui/dist/app
|
|
|
|
echo "Built without static files" > ui/dist/app/index.html
|
|
|
|
|
|
|
|
${staticfiles}/bin/staticfiles -o server/static/files.go ui/dist/app
|
|
|
|
'';
|
|
|
|
|
2020-06-11 21:56:29 +00:00
|
|
|
buildFlagsArray = ''
|
|
|
|
-ldflags=
|
|
|
|
-s -w
|
|
|
|
-X github.com/argoproj/argo.version=${version}
|
|
|
|
-X github.com/argoproj/argo.gitCommit=${src.rev}
|
|
|
|
-X github.com/argoproj/argo.gitTreeState=clean
|
|
|
|
-X github.com/argoproj/argo.gitTag=${version}
|
|
|
|
'';
|
|
|
|
|
2020-06-26 03:01:51 +00:00
|
|
|
postInstall = ''
|
|
|
|
for shell in bash zsh; do
|
|
|
|
$out/bin/argo completion $shell > argo.$shell
|
|
|
|
installShellCompletion argo.$shell
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2020-03-27 07:33:21 +00:00
|
|
|
meta = with lib; {
|
2019-01-26 00:43:58 +00:00
|
|
|
description = "Container native workflow engine for Kubernetes";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/argoproj/argo";
|
2019-01-26 00:43:58 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ groodt ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2020-06-11 21:56:29 +00:00
|
|
|
}
|