This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 362
/
Makefile
44 lines (35 loc) · 1.91 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
39
40
41
42
43
44
run:
go run -tags $(or $(datree_build_env),staging) -ldflags="-X github.com/datreeio/datree/cmd.CliVersion=1.0.0" main.go test ./internal/fixtures/**/*.yaml
run-production:
make datree_build_env=main run
run-staging:
make datree_build_env=staging run
run-dev:
make datree_build_env=dev run
build:
go build -tags $(or $(datree_build_env),staging) -ldflags="-X github.com/datreeio/datree/cmd.CliVersion=1.0.0"
build-production:
make datree_build_env=main build
build-staging:
make datree_build_env=staging build
build-dev:
make datree_build_env=dev build
build-windows-amd:
GOOS=windows GOARCH=amd64 go build -tags $(or $(datree_build_env),staging) -ldflags="-X github.com/datreeio/datree/cmd.CliVersion=1.0.0"
test:
# when changing rule logic in the project's defaultRules.yaml, we want to ensure our new logic is used when running "make test"
# if we don't delete `defaultRules.yaml`, the tests will use the old logic
rm -f ~/.datree/defaultRules.yaml
go test ./...
create-bin:
goreleaser --snapshot --skip-publish --rm-dist
print-version:
go run -tags=staging -ldflags="-X github.com/datreeio/datree/cmd.CliVersion=1.0.0" main.go version
set-token:
go run -tags=staging -ldflags="-X github.com/datreeio/datree/cmd.CliVersion=1.0.0" main.go config set token testtoken
publish:
go run -tags=staging -ldflags="-X github.com/datreeio/datree/cmd.CliVersion=1.0.0" main.go publish ./internal/fixtures/policyAsCode/valid-schema.yaml
datree_test_to_JUnit_report: # install junit2html first: https://github.com/inorton/junit2html
make build && ./datree test ./internal/fixtures/kube/skipRule/k8s-demo-skip-two.yaml -o JUnit > ./internal/fixtures/junit_support/datree_test_junit.xml || true && junit2html ./internal/fixtures/junit_support/datree_test_junit.xml ./internal/fixtures/junit_support/datree_test_junit_report.html
lint: # install golangci-lint first: https://golangci-lint.run/usage/install/#local-installation
golangci-lint run