Skip to content

Commit

Permalink
simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
adranwit committed Aug 2, 2023
1 parent e627ea6 commit 3d35a34
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion cmd/command/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/viant/datly/internal/codegen/ast"
"github.com/viant/datly/internal/plugin"
"github.com/viant/datly/internal/translator"
"github.com/viant/pgo"
"os"
"os/exec"
)
Expand Down Expand Up @@ -85,7 +86,25 @@ func (s *Service) PrepareBuild(ctx context.Context, build *options.Build) error
if err := s.tidyModule(ctx, build.Datly); err != nil {
return err
}
return nil

flags := ""
if build.LdFlags != nil {
flags = *build.LdFlags
}
return pgo.Build(&pgo.Options{
Name: build.Name,
SourceURL: build.Source,
DestURL: build.DestURL,
Arch: build.GoArch,
Os: build.GoOs,
Version: build.GoVersion,
MainPath: build.MainPath,
BuildArgs: build.BuildArgs,
BuildMode: "exec",
Compression: "gzip",
WithLogger: true,
LdFlags: flags,
})
}

func (s *Service) tidyModule(ctx context.Context, goModule string) error {
Expand Down

0 comments on commit 3d35a34

Please sign in to comment.