Populate Zabbix server with test data via API
Source
.PHONY: build
.SILENT: build
BUILD_VERSION?=$(shell git describe --tags --abbrev=0)
help:
@echo "version $(BUILD_VERSION)"
@echo ""
@echo "Make commands, should be used only when on master branch:"
@echo "test run phpunit tests"
@echo "build build phar archive with version tag and push to origin"
@echo "copyrights fix copyrights headers in php files to match current year"
test:
clear && composer test
build: test
rm -f ./generate
@echo "Current version $(BUILD_VERSION)"
@echo "Enter version: (1.4, 2.0, X.X)"
@read VERSION_TAG && \
php --define phar.readonly=0 ./build.php $$VERSION_TAG && \
mv generate.phar generate && \
chmod +x generate && \
git add ./generate && \
git commit -m "phar build" && \
git push && \
git tag $$VERSION_TAG
git push origin --tags
copyrights:
find ./ -type f -name '*.php' -exec sed -i "/^\*\* Copyright (C) 2001/s/-\b[0-9]\{4\}/-$$(date +%Y)/" '{}' \;