Build: make bra a local dependency (#17414)

Same idea as with the `gosec`, `revive` and etc.
Allows you to execute `make bra` as pinned local dependency instead
as global one. And therefore alleviates dependency installation issues.

README also updated - I was thinking to provide verbose installation instructions
for it. Since with that way we assume make is installed on the
developer system.

But it might be premature right now?
This commit is contained in:
Oleg Gaidarenko
2019-06-07 16:42:08 +03:00
committed by GitHub
parent 2316414786
commit bc7c420ee8
5 changed files with 82 additions and 32 deletions

View File

@@ -57,10 +57,6 @@ test-js:
test: test-go test-js
run:
@echo "start a server"
./bin/grafana-server
clean:
@echo "cleaning"
rm -rf node_modules
@@ -78,6 +74,10 @@ scripts/go/bin/gosec: scripts/go/go.mod
@cd scripts/go; \
$(GO) build -o ./bin/gosec github.com/securego/gosec/cmd/gosec
scripts/go/bin/bra: scripts/go/go.mod
@cd scripts/go; \
$(GO) build -o ./bin/bra github.com/Unknwon/bra
revive: scripts/go/bin/revive
@scripts/go/bin/revive \
-formatter stylish \
@@ -89,6 +89,16 @@ revive-alerting: scripts/go/bin/revive
-formatter stylish \
./pkg/services/alerting/...
run: scripts/go/bin/bra
@scripts/go/bin/bra run
# TODO recheck the rules and leave only necessary exclusions
gosec: scripts/go/bin/gosec
@scripts/go/bin/gosec -quiet \
-exclude=G104,G107,G201,G202,G204,G301,G304,G401,G402,G501 \
-conf=./scripts/go/configs/gosec.json \
$(GO_FILES)
# create docker-compose file with provided sources and start them
# example: make devenv sources=postgres,openldap
ifeq ($(sources),)
@@ -111,10 +121,3 @@ devenv-down:
@cd devenv; \
test -f docker-compose.yaml && \
docker-compose down || exit 0;
# TODO recheck the rules and leave only necessary exclusions
gosec: scripts/go/bin/gosec
@scripts/go/bin/gosec -quiet \
-exclude=G104,G107,G201,G202,G204,G301,G304,G401,G402,G501 \
-conf=./scripts/go/configs/gosec.json \
$(GO_FILES)