-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGNUmakefile
58 lines (47 loc) · 1.62 KB
/
GNUmakefile
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
56
57
58
default: test
NAME=qdrant-cloud
BINARY=terraform-provider-${NAME}
VERSION=1.0
OS=$(shell uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(shell uname -m)
OS_ARCH=${OS}_${ARCH}
NAMESPACE=local
QDRANT_CLOUD_API_KEY ?=
QDRANT_CLOUD_ACCOUNT_ID ?=
# Get the latest tag
LATEST_TAG := $(shell git describe --tags `git rev-list --tags --max-count=1`)
# Use the latest tag in a target
print-latest-tag:
@echo "The latest tag is $(LATEST_TAG)"
.PHONY: testacc generate-client
# Run acceptance tests
test:
ifndef QDRANT_CLOUD_API_KEY
$(error QDRANT_CLOUD_API_KEY is not set)
endif
ifndef QDRANT_CLOUD_ACCOUNT_ID
$(error QDRANT_CLOUD_ACCOUNT_ID is not set)
endif
TF_ACC=1 go test ./qdrant/... -v $(TESTARGS) -timeout 120m
requirements:
go install github.com/goreleaser/goreleaser/v2@latest
go install github.com/mitchellh/gox@latest
build: requirements
goreleaser release --snapshot --clean
.PHONY: update-go-client
update-go-client:
rm -r ./internal/client
mkdir ./internal/client
cp -R -v ../qdrant-cloud-cluster-api/pypi/go-client-programmatic-access/* ./internal/client
install: build
mkdir -p ~/.terraform.d/plugins/${NAMESPACE}/${NAME}/${NAME}/${VERSION}/${OS_ARCH}
cp bin/${OS}/${ARCH}/${BINARY}_v$(VERSION) ~/.terraform.d/plugins/${NAMESPACE}/${NAME}/${NAME}/${VERSION}/${OS_ARCH}/${BINARY}
install-in-gobin: build
mkdir -p ~/.terraform.d/plugins/${NAMESPACE}/${NAME}/${NAME}/${VERSION}/${OS_ARCH}
cp dist/${BINARY}_${OS}_${ARCH}/${BINARY}_$(LATEST_TAG)-next ${HOME}/go/bin/terraform-provider-qdrant-cloud
.PHONY: generate-help
generate-help:
go generate ./...
.PHONY: checksum
checksum:
find bin -type f -exec sha256sum {} \; > checksums.txt