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

Setup an independent build for x-pack/winlogbeat #11679

Merged
merged 3 commits into from
May 1, 2019

Conversation

andrewkroh
Copy link
Member

Put the infrastructure in place to give x-pack/winlogbeat its own independent build.
This adds some utility code that can be used by other beats to reduce duplication.

cd winlogbeat && mage -l
Targets:
  goTestUnit            is an alias for goUnitTest.
  update                is an alias for update:all.
  check                 formats code, updates generated content, check for common errors, and checks for any modified files.
  clean                 cleans all generated files and build artifacts.
  dumpVariables         writes the template variables and values to stdout.
  fmt                   formats source code (.go and .py) and adds license headers.
  build                 builds the Beat binary.
  buildGoDaemon         builds the go-daemon binary (use crossBuildGoDaemon).
  crossBuild            cross-builds the beat for all target platforms.
  crossBuildGoDaemon    cross-builds the go-daemon binary using Docker.
  golangCrossBuild      build the Beat binary inside of the golang-builder.
  packageTest           tests the generated packages in build/distributions.
  dashboards:export     exports a dashboard from Kibana and writes it into the correct directory.
  dashboards:import     imports dashboards to Kibana using the Beat setup command.
  docs                  generates the documentation for the Beat.
  test                  runs all available tests (unitTest + integTest).
  goUnitTest            executes the Go unit tests.
  pythonUnitTest        executes the python system tests.
  unitTest              executes the unit tests (Go and Python).
  update:all            updates all generated content.
  update:config         updates the Beat's config files.
  update:dashboards     collects all the dashboards and generates index patterns.
  update:fieldDocs      updates the field documentation.
  update:fields         updates all fields files (.go, .yml).
  package               packages the Beat for distribution.

Copy link
Contributor

@ruflin ruflin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skimmed through it and so far looks good to me. But I think me or someone else should go through it again in more detail.

If I understand this correctly quite a few of the changes are actual cleanups of the existing code and not directly related to the x-pack/winlogbeat? I wonder if we should split it up in more PR's? ;-)

dev-tools/mage/docs.go Show resolved Hide resolved
dev-tools/mage/kibana.go Outdated Show resolved Hide resolved
@andrewkroh andrewkroh force-pushed the feature/wlb/xpack-build branch from eca9fca to 8990542 Compare April 8, 2019 23:11
@andrewkroh
Copy link
Member Author

I wonder if we should split it up in more PR's? ;-)

This is the split up version of the massive #9842. 😅

@ruflin
Copy link
Contributor

ruflin commented Apr 9, 2019

I'm pretty sure I asked there the same question 🤦‍♂️

@andrewkroh andrewkroh force-pushed the feature/wlb/xpack-build branch 2 times, most recently from eba6935 to 0002d0e Compare April 10, 2019 17:24
@andrewkroh andrewkroh requested a review from mikemadden42 April 24, 2019 12:18
Copy link
Contributor

@ruflin ruflin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, great job.

Would be great to have a deep dive session for beats contributors on all the mage magic at one time in the future ;-)


"github.com/elastic/beats/dev-tools/mage"

// mage:import
_ "github.com/elastic/beats/dev-tools/mage/target/common"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mage:import is great and will simplify things a lot.

@@ -0,0 +1,60 @@
// Licensed to Elasticsearch B.V. under one or more contributor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels quite a bit hidden in scripts package but not something to address for this PR, more a general comment.


// Dashboards collects all the dashboards and generates index patterns.
func (Update) Dashboards() error {
mg.Deps(fb.FieldsYML)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Had to search for the definition of this. Would probably be nicer to have a more descriptive name or defined directly in here.

Put the infrastructure in place to give x-pack/winlogbeat its own independent build.
This adds some utility code that can be used by other beats to reduce duplication.

    cd winlogbeat && mage -l
    Targets:
      goTestUnit            is an alias for goUnitTest.
      update                is an alias for update:all.
      check                 formats code, updates generated content, check for common errors, and checks for any modified files.
      clean                 cleans all generated files and build artifacts.
      dumpVariables         writes the template variables and values to stdout.
      fmt                   formats source code (.go and .py) and adds license headers.
      build                 builds the Beat binary.
      buildGoDaemon         builds the go-daemon binary (use crossBuildGoDaemon).
      crossBuild            cross-builds the beat for all target platforms.
      crossBuildGoDaemon    cross-builds the go-daemon binary using Docker.
      golangCrossBuild      build the Beat binary inside of the golang-builder.
      packageTest           tests the generated packages in build/distributions.
      dashboards:export     exports a dashboard from Kibana and writes it into the correct directory.
      dashboards:import     imports dashboards to Kibana using the Beat setup command.
      docs                  generates the documentation for the Beat.
      test                  runs all available tests (unitTest + integTest).
      goUnitTest            executes the Go unit tests.
      pythonUnitTest        executes the python system tests.
      unitTest              executes the unit tests (Go and Python).
      update:all            updates all generated content.
      update:config         updates the Beat's config files.
      update:dashboards     collects all the dashboards and generates index patterns.
      update:fieldDocs      updates the field documentation.
      update:fields         updates all fields files (.go, .yml).
      package               packages the Beat for distribution.
@andrewkroh andrewkroh force-pushed the feature/wlb/xpack-build branch from 0002d0e to d650124 Compare May 1, 2019 03:38
@andrewkroh andrewkroh merged commit 8bd2510 into elastic:master May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants