argo: build staticfiles with buildGoModule

This commit is contained in:
Aaron Jheng 2023-01-04 06:17:12 +00:00
parent 9813adc7f7
commit 31e1952952
No known key found for this signature in database
GPG key ID: F6A547A869D050A3
2 changed files with 17 additions and 4 deletions

View file

@ -12,16 +12,25 @@ let
# 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 = pkgsBuildBuild.buildGoPackage rec {
staticfiles = pkgsBuildBuild.buildGoModule rec {
name = "staticfiles";
src = fetchFromGitHub {
owner = "bouk";
repo = "staticfiles";
rev = "827d7f6389cd410d0aa3f3d472a4838557bf53dd";
sha256 = "0xarhmsqypl8036w96ssdzjv3k098p2d4mkmw5f6hkp1m3j67j61";
hash = "sha256-wchj5KjhTmhc4XVW0sRFCcyx5W9am8TNAIhej3WFWXU=";
};
goPackagePath = "bou.ke/staticfiles";
vendorHash = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo=";
excludedPackages = [ "./example" ];
preBuild = ''
cp ${./staticfiles.go.mod} go.mod
'';
ldflags = [ "-s" "-w" ];
};
in
buildGoModule rec {
@ -55,7 +64,8 @@ buildGoModule rec {
'';
ldflags = [
"-s" "-w"
"-s"
"-w"
"-X github.com/argoproj/argo-workflows/v3.buildDate=unknown"
"-X github.com/argoproj/argo-workflows/v3.gitCommit=${src.rev}"
"-X github.com/argoproj/argo-workflows/v3.gitTag=${src.rev}"

View file

@ -0,0 +1,3 @@
module bou.ke/staticfiles
go 1.18