Skip to content

Commit

Permalink
Building functionbeat providers with specific GOOS and GOARCH (#15586) (
Browse files Browse the repository at this point in the history
#15753)

* Building functionbeat providers with specific GOOS and GOARCH

* Fix: os changed to linux for aws functionbeat provider

* Disabling CGO in functionbeat because it is not used

Co-authored-by: Rodrigo Villablanca Vásquez <villa061004@gmail.com>
  • Loading branch information
ycombinator and rvillablanca authored Jan 28, 2020
1 parent b5c4b95 commit dd971a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions x-pack/functionbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ func Build() error {
params.InputFiles = []string{inputFiles}
params.Name = devtools.BeatName + "-" + provider.Name
params.OutputDir = filepath.Join("provider", provider.Name)
params.CGO = false
params.Env = make(map[string]string)
if provider.GOOS != "" {
params.Env["GOOS"] = provider.GOOS
}
if provider.GOARCH != "" {
params.Env["GOARCH"] = provider.GOARCH
}
err := devtools.Build(params)
if err != nil {
return err
Expand Down
4 changes: 3 additions & 1 deletion x-pack/functionbeat/scripts/mage/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

var (
availableProviders = []ProviderDetails{
{Name: "aws", Buildable: true},
{Name: "aws", Buildable: true, GOOS: "linux", GOARCH: "amd64"},
{Name: "gcp", Buildable: false},
}
)
Expand All @@ -21,6 +21,8 @@ var (
type ProviderDetails struct {
Name string
Buildable bool
GOOS string
GOARCH string
}

// SelectedProviders is the list of selected providers
Expand Down

0 comments on commit dd971a3

Please sign in to comment.