What is/will be the preferred way of creating a new go application that uses libbeat 6.1?
- The official documentation says to generate the new project using the cookie cutter template:
make setup just copies the content of the libbeat from GOPATH to the vendor folder.
Drawbacks: vendor/github.com/elastic/ is not managed by govendor tool
- use govendor tool
I followed the same setup as https://github.com/elastic/apm-server
Drawbacks: needs to hack the vendor/vendor.json file to update the origin.
It doesn't work out of the box
govendor fetch github.com/elastic/beats/...@$(BEATS_VERSION) govendor fetch github.com/elastic/beats/libbeat/kibana/@$(BEATS_VERSION) scripts/patch_vendorjson.py BEATS_VERSION=$(BEATS_VERSION) scripts/update_beats.sh scripts/patch_vendorjson.py --done BEATS_VERSION=$(BEATS_VERSION) scripts/update_beats.sh
scripts/patch_vendorjson.py patches the vendor.json (created by
govendor fetch github.com/elastic/beats/...) to set the origin of all packages to github.com/elastic/beats/vendor/github.com/xxx/xxx)
Without this patch, the script
update_beats.sh does nothing
However, there are still some issues.
make set_version 1.2.3 does not work because it expects
set_version python file to be in
./vendor/github.com/elastic/beats/dev-tools/set_version. But the file is now in
Both solutions no longer work out of the box!
I can submit PR but I need guidance on the best way to create/update new projects.