Update Makefile

This commit is contained in:
Blerim Sheqa 2019-08-15 14:05:30 +02:00
parent 782f0ad3c8
commit 97a5b11407
1 changed files with 22 additions and 27 deletions

View File

@ -1,13 +1,17 @@
BEAT_NAME=icingabeat
BEAT_DIR=github.com/icinga/icingabeat
BEAT_PATH=github.com/icinga/icingabeat
BEAT_DESCRIPTION=Icingabeat ships Icinga 2 events and states to Elasticsearch or Logstash.
BEAT_VENDOR=Icinga
BEAT_DOC_URL=https://github.com/Icinga/icingabeat
BEAT_PATH=github.com/icinga/icingabeat
BEAT_GOPATH=$(firstword $(subst :, ,${GOPATH}))
SYSTEM_TESTS=false
TEST_ENVIRONMENT=false
ES_BEATS?=./vendor/github.com/elastic/beats
GOPACKAGES=$(shell glide novendor)
LIBBEAT_MAKEFILE=$(ES_BEATS)/libbeat/scripts/Makefile
GOPACKAGES=$(shell govendor list -no-status +local)
GOBUILD_FLAGS=-i -ldflags "-X $(BEAT_PATH)/vendor/github.com/elastic/beats/libbeat/version.buildTime=$(NOW) -X $(BEAT_PATH)/vendor/github.com/elastic/beats/libbeat/version.commit=$(COMMIT_ID)"
MAGE_IMPORT_PATH=${BEAT_PATH}/vendor/github.com/magefile/mage
NO_COLLECT=true
PREFIX?=.
TESTIFY_TOOL_REPO?=github.com/stretchr/testify
CHECK_HEADERS_DISABLED=true
@ -17,39 +21,30 @@ CHECK_HEADERS_DISABLED=true
#SNAPSHOT=false
# Path to the libbeat Makefile
-include $(ES_BEATS)/libbeat/scripts/Makefile
-include $(LIBBEAT_MAKEFILE)
# Initial beat setup
.PHONY: setup
setup: copy-vendor
make update
setup: pre-setup git-add
pre-setup: copy-vendor git-init
$(MAKE) -f $(LIBBEAT_MAKEFILE) mage ES_BEATS=$(ES_BEATS)
$(MAKE) -f $(LIBBEAT_MAKEFILE) update BEAT_NAME=$(BEAT_NAME) ES_BEATS=$(ES_BEATS) NO_COLLECT=$(NO_COLLECT)
# Copy beats into vendor directory
.PHONY: copy-vendor
copy-vendor:
mkdir -p vendor/github.com/elastic/
cp -R ${GOPATH}/src/github.com/elastic/beats vendor/github.com/elastic/
rm -rf vendor/github.com/elastic/beats/.git
mkdir -p vendor/github.com/elastic
cp -R ${BEAT_GOPATH}/src/github.com/elastic/beats vendor/github.com/elastic/
rm -rf vendor/github.com/elastic/beats/.git vendor/github.com/elastic/beats/x-pack
mkdir -p vendor/github.com/magefile
cp -R ${BEAT_GOPATH}/src/github.com/elastic/beats/vendor/github.com/magefile/mage vendor/github.com/magefile
.PHONY: git-init
git-init:
git init
git add README.md CONTRIBUTING.md
git commit -m "Initial commit"
git add LICENSE
git commit -m "Add the LICENSE"
git add .gitignore
git commit -m "Add git settings"
git add .
git reset -- .travis.yml
git commit -m "Add icingabeat"
git add .travis.yml
git commit -m "Add Travis CI"
# This is called by the beats packer before building starts
.PHONY: before-build
before-build:
# Collects all dependencies and then calls update
.PHONY: collect
collect:
.PHONY: git-add
git-add:
git add -A
git commit -m "Add generated icingabeat files"