This repository was archived by the owner on May 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (36 loc) · 1.37 KB
/
Makefile
File metadata and controls
47 lines (36 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.PHONY: release build clean test
SUDO := $(shell docker info > /dev/null 2> /dev/null || echo "sudo")
TEST_FLAGS?=
# NB default target architecture is amd64. If you would like to try the
# other one -- pass an ARCH variable, e.g.,
# `make ARCH=arm64`
ifeq ($(ARCH),)
ARCH=amd64
endif
CURRENT_OS_ARCH=$(shell echo `go env GOOS`-`go env GOARCH`)
GOBIN?=$(shell echo `go env GOPATH`/bin)
IMAGE_TAG:=$(shell ./container/image-tag.sh)
VCS_REF:=$(shell git rev-parse HEAD)
BUILD_DATE:=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
HELM_REGISTRY_PATH="./docs/helm"
HELM_REGISTRY_URL="https://releases.universe.sh/helm/"
all: release
release:
go build -buildmode=c-shared -o build/out_gcs.so $(LDFLAGS) -ldflags "-X main.version=$(shell ./container/image-tag.sh)";
clean:
go clean
rm -rf ./build
test:
PATH="${PWD}/bin:${PWD}/test/bin:${PATH}" go test ${TEST_FLAGS} $(shell go list ./... | sort -u)
build: container/Dockerfile
mkdir -p ./build/
cp $^ ./build/
cp plugins.conf ./build/
$(SUDO) docker build -t quay.io/universe-sh/fluent-bit-out-gcs -t quay.io/universe-sh/fluent-bit-out-gcs:$(IMAGE_TAG) \
--build-arg VCS_REF="$(VCS_REF)" \
--build-arg BUILD_DATE="$(BUILD_DATE)" \
-f build/Dockerfile ./build/
touch $@
helm:
helm package helm/* --destination ${HELM_REGISTRY_PATH}
helm repo index --url ${HELM_REGISTRY_URL} ${HELM_REGISTRY_PATH} --merge ${HELM_REGISTRY_PATH}/index.yaml