Skip to content

Commit

Permalink
Add PROJECTS_XPACK_MAGE to top-level Makefile
Browse files Browse the repository at this point in the history
(cherry picked from commit fd70623)
  • Loading branch information
andrewkroh authored and sayden committed Nov 26, 2018
1 parent 48c5c17 commit d997a82
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@ REVIEWDOG_OPTIONS?=-diff "git diff master"
REVIEWDOG_REPO=github.com/haya14busa/reviewdog/cmd/reviewdog
XPACK_SUFFIX=x-pack/

# PROJECTS_XPACK_MAGE is a list of Beats whose primary build logic is based in
# Mage. For compatibility with CI testing these projects support a subset of the
# makefile targets. After all Beats converge to primarily using Mage we can
# remove this and treat all sub-projects the same.
PROJECTS_XPACK_MAGE=x-pack/filebeat x-pack/metricbeat

# Runs complete testsuites (unit, system, integration) for all beats with coverage and race detection.
# Also it builds the docs and the generators

.PHONY: testsuite
testsuite:
@$(foreach var,$(PROJECTS),$(MAKE) -C $(var) testsuite || exit 1;)
@$(foreach var,$(PROJECTS) $(PROJECTS_XPACK_MAGE),$(MAKE) -C $(var) testsuite || exit 1;)

.PHONY: setup-commit-hook
setup-commit-hook:
Expand Down Expand Up @@ -54,13 +60,13 @@ coverage-report:

.PHONY: update
update: notice
@$(foreach var,$(PROJECTS),$(MAKE) -C $(var) update || exit 1;)
@$(foreach var,$(PROJECTS) $(PROJECTS_XPACK_MAGE),$(MAKE) -C $(var) update || exit 1;)
@$(MAKE) -C deploy/kubernetes all

.PHONY: clean
clean:
@rm -rf build
@$(foreach var,$(PROJECTS),$(MAKE) -C $(var) clean || exit 1;)
@$(foreach var,$(PROJECTS) $(PROJECTS_XPACK_MAGE),$(MAKE) -C $(var) clean || exit 1;)
@$(MAKE) -C generator clean
@-mage -clean 2> /dev/null

Expand All @@ -72,7 +78,7 @@ clean-vendor:

.PHONY: check
check: python-env
@$(foreach var,$(PROJECTS) dev-tools x-pack/filebeat x-pack/metricbeat,$(MAKE) -C $(var) check || exit 1;)
@$(foreach var,$(PROJECTS) dev-tools $(PROJECTS_XPACK_MAGE),$(MAKE) -C $(var) check || exit 1;)
@# Checks also python files which are not part of the beats
@$(FIND) -name *.py -exec $(PYTHON_ENV)/bin/autopep8 -d --max-line-length 120 {} \; | (! grep . -q) || (echo "Code differs from autopep8's style" && false)
@# Validate that all updates were committed
Expand Down Expand Up @@ -107,7 +113,7 @@ misspell:

.PHONY: fmt
fmt: add-headers python-env
@$(foreach var,$(PROJECTS) dev-tools x-pack/filebeat x-pack/metricbeat,$(MAKE) -C $(var) fmt || exit 1;)
@$(foreach var,$(PROJECTS) dev-tools $(PROJECTS_XPACK_MAGE),$(MAKE) -C $(var) fmt || exit 1;)
@# Cleans also python files which are not part of the beats
@$(FIND) -name "*.py" -exec $(PYTHON_ENV)/bin/autopep8 --in-place --max-line-length 120 {} \;

Expand Down
25 changes: 15 additions & 10 deletions dev-tools/make/xpack.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@
#
# Variables
#
PWD := $(CURDIR)
.DEFAULT_GOAL := help
PWD := $(CURDIR)

#
# Includes
#
include $(ES_BEATS)/dev-tools/make/mage.mk

#
# Targets
# Targets (alphabetically sorted).
#
.PHONY: check
check: mage
mage check

.PHONY: clean
clean: mage
mage clean
Expand All @@ -23,16 +27,17 @@ clean: mage
fmt: mage
mage fmt

.PHONY: check
check: mage
mage check

.PHONY: testsuite
testsuite: mage
mage update build unitTest integTest

# Default target.
.PHONY: help
help:
@echo Use mage rather than make. Here are the available mage targets:
@mage -l

.PHONY: testsuite
testsuite: mage
mage update build unitTest integTest

.PHONY: update
update: mage
mage update

0 comments on commit d997a82

Please sign in to comment.