forked from open-feature/flagd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (38 loc) · 1.28 KB
/
Makefile
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
IMG ?= flagd:latest
PHONY: .docker-build .build .run
PREFIX=/usr/local
guard-%:
@ if [ "${${*}}" = "" ]; then \
echo "Environment variable $* not set"; \
exit 1; \
fi
generate:
git submodule update --init --recursive
cp schemas/json/flagd-definitions.json pkg/eval/flagd-definitions.json
go install github.com/bufbuild/buf/cmd/buf@latest
cd schemas/protobuf && buf generate
docker-build: generate
docker buildx build --platform="linux/ppc64le,linux/s390x,linux/amd64,linux/arm64" -t ${IMG} .
docker-push: generate
docker buildx build --push --platform="linux/ppc64le,linux/s390x,linux/amd64,linux/arm64" -t ${IMG} .
build: generate
go build -o flagd
test: generate
go test -cover ./...
run: generate
go run main.go start -f config/samples/example_flags.json
install:
cp systemd/flagd.service /etc/systemd/system/flagd.service
mkdir -p /etc/flagd
cp systemd/flags.json /etc/flagd/flags.json
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp flagd $(DESTDIR)$(PREFIX)/bin/flagd
systemctl start flagd
uninstall:
systemctl disable flagd
systemctl stop flagd
rm /etc/systemd/system/flagd.service
rm -f $(DESTDIR)$(PREFIX)/bin/flagd
lint:
go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@latest
${GOPATH}/bin/golangci-lint run --deadline=3m --timeout=3m ./... # Run linters