-
Notifications
You must be signed in to change notification settings - Fork 322
/
makefile
55 lines (39 loc) · 1.81 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
45
46
47
48
49
50
51
52
53
54
55
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
GOOS?=darwin
GOARCH?=arm64
MAKEFLAGS += --silent
VERSION=$$(git describe --tags)
build:
CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=$(VERSION)" -o terraform-provider-keycloak_$(VERSION)
build-debug:
# keep debug info in the binary
CGO_ENABLED=0 go build -gcflags "all=-N -l" -trimpath -ldflags " -X main.version=$(VERSION)" -o terraform-provider-keycloak_$(VERSION)
prepare-example:
mkdir -p example/.terraform/plugins/terraform.local/keycloak/keycloak/4.5.0/$(GOOS)_$(GOARCH)
mkdir -p example/terraform.d/plugins/terraform.local/keycloak/keycloak/4.5.0/$(GOOS)_$(GOARCH)
cp terraform-provider-keycloak_* example/.terraform/plugins/terraform.local/keycloak/keycloak/4.5.0/$(GOOS)_$(GOARCH)/
cp terraform-provider-keycloak_* example/terraform.d/plugins/terraform.local/keycloak/keycloak/4.5.0/$(GOOS)_$(GOARCH)/
build-example: build prepare-example
build-example-debug: build-debug prepare-example
run-debug:
echo "Starting delve debugger listening on port 127.0.0.1:58772"
dlv exec --listen=:58772 --accept-multiclient --headless "./terraform-provider-keycloak_$(VERSION)" -- -debug
local: deps user-federation-example
docker compose up --build -d
./scripts/wait-for-local-keycloak.sh
./scripts/create-terraform-client.sh
deps:
./scripts/check-deps.sh
fmt:
gofmt -w -s $(GOFMT_FILES)
test: fmtcheck vet
go test $(TEST)
testacc: fmtcheck vet
go test -v github.com/keycloak/terraform-provider-keycloak/keycloak
TF_ACC=1 CHECKPOINT_DISABLE=1 go test -v -timeout 60m -parallel 4 github.com/keycloak/terraform-provider-keycloak/provider $(TESTARGS)
fmtcheck:
lineCount=$(shell gofmt -l -s $(GOFMT_FILES) | wc -l | tr -d ' ') && exit $$lineCount
vet:
go vet ./...
user-federation-example:
cd custom-user-federation-example && ./gradlew shadowJar