Skip to content

Instantly share code, notes, and snippets.

@markuman
Created July 16, 2019 10:34
Show Gist options
  • Select an option

  • Save markuman/075bd73d4dd6b44af31efb6178da70ba to your computer and use it in GitHub Desktop.

Select an option

Save markuman/075bd73d4dd6b44af31efb6178da70ba to your computer and use it in GitHub Desktop.
.PHONY: help
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help
dir: ## create fluent-bit output directory
mkdir -p fluent-bit/
fbit: ## build fluent-bit binary
wget https://github.com/fluent/fluent-bit/archive/v$(VERSION).tar.gz
tar xf v$(VERSION).tar.gz
cd fluent-bit-$(VERSION)/build && cmake .. && make -j 2
mkdir -p /mnt/$(OS)/
cp -a fluent-bit-$(VERSION)/build/bin/fluent-bit /mnt/$(OS)/fluent-bit-$(VERSION)
generic: dir ## generic wrapper to invoke fbit
docker build -t fbit:$(OS) -f Dockerfile.$(OS) .
docker run -ti --rm -v $(shell pwd)/fluent-bit:/mnt fbit:$(OS) make VERSION=$(VERSION) OS=$(OS) fbit
buster: dir ## build fluent-bit for debian 10
$(MAKE) VERSION=$(VERSION) OS=buster -s generic
jessie: dir ## build fluent-bit for debian 8
$(MAKE) VERSION=$(VERSION) OS=jessie -s generic
stretch: dir ## build fluent-bit for debian 9
$(MAKE) VERSION=$(VERSION) OS=stretch -s generic
bionic: dir ## build fluent-bit for ubuntu 18.04
$(MAKE) VERSION=$(VERSION) OS=ubuntu1804 -s generic
disco: dir ## build fluent-bit for debian 19.04
$(MAKE) VERSION=$(VERSION) OS=ubuntu1904 -s generic
alpine: dir ## build fluent-bit for alpine 3.10
$(MAKE) VERSION=$(VERSION) OS=alpine310 -s generic
amznlnx: dir ## build fluent-bit for amazon linux 2
$(MAKE) VERSION=$(VERSION) OS=amznlnx2 -s generic
sync:
s3cmd sync --verbose fluent-bit/ s3://$(BUCKET)/fluent-bit/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment