Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick #15140 to 7.5: Fix mage package on generated beats #15383

Merged
merged 2 commits into from
Jan 11, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ jobs:

# Generators
- os: linux
env: TARGETS="-C generator/metricbeat test"
env: TARGETS="-C generator/metricbeat test test-package"
go: $TRAVIS_GO_VERSION
stage: test
- os: linux
env: TARGETS="-C generator/beat test"
env: TARGETS="-C generator/beat test test-package"
go: $TRAVIS_GO_VERSION
stage: test

Expand Down
11 changes: 11 additions & 0 deletions generator/beat/{beat}/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,14 @@ func Build() error {
func CrossBuild() error {
return build.CrossBuild()
}

// BuildGoDaemon builds the go-daemon binary (use crossBuildGoDaemon).
func BuildGoDaemon() error {
return build.BuildGoDaemon()
}

// GolangCrossBuild build the Beat binary inside of the golang-builder.
// Do not use directly, use crossBuild instead.
func GolangCrossBuild() error {
return build.GolangCrossBuild()
}
6 changes: 6 additions & 0 deletions generator/common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ test: prepare-test
$(MAKE) || exit 1 ; \
$(MAKE) unit

.PHONY: test-package
test-package: test
cd ${BEAT_PATH} ; \
export PATH=$${GOPATH}/bin:$${PATH}; \
mage package

.PHONY: prepare-test
prepare-test:: python-env
# Makes sure to use current version of beats for testing
Expand Down
11 changes: 11 additions & 0 deletions generator/metricbeat/{beat}/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,14 @@ func Build() error {
func CrossBuild() error {
return build.CrossBuild()
}

// BuildGoDaemon builds the go-daemon binary (use crossBuildGoDaemon).
func BuildGoDaemon() error {
return build.BuildGoDaemon()
}

// GolangCrossBuild build the Beat binary inside of the golang-builder.
// Do not use directly, use crossBuild instead.
func GolangCrossBuild() error {
return build.GolangCrossBuild()
}