53 lines
1.5 KiB
Makefile
53 lines
1.5 KiB
Makefile
.PHONY: build install test clean fmt vet
|
|
|
|
# Default target
|
|
default: build
|
|
|
|
# Build the provider
|
|
build:
|
|
go build -o terraform-provider-edge-connect
|
|
|
|
# Install the provider locally
|
|
install: build
|
|
mkdir -p ~/.terraform.d/plugins/registry.terraform.io/DevFW-CICD/edge-connect/1.0.0/$$(go env GOOS)_$$(go env GOARCH)
|
|
cp terraform-provider-edge-connect ~/.terraform.d/plugins/registry.terraform.io/DevFW-CICD/edge-connect/1.0.0/$$(go env GOOS)_$$(go env GOARCH)/
|
|
|
|
# Run tests
|
|
test:
|
|
go test -v ./...
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
rm -f terraform-provider-edge-connect
|
|
rm -rf .terraform/
|
|
rm -f .terraform.lock.hcl
|
|
rm -f terraform.tfstate*
|
|
|
|
# Format Go code
|
|
fmt:
|
|
go fmt ./...
|
|
|
|
# Run go vet
|
|
vet:
|
|
go vet ./...
|
|
|
|
# Lint the code
|
|
lint:
|
|
golangci-lint run
|
|
|
|
# Run all checks
|
|
check: fmt vet test
|
|
|
|
# Build for multiple platforms
|
|
build-all:
|
|
GOOS=darwin GOARCH=amd64 go build -o bin/terraform-provider-edge-connect_darwin_amd64
|
|
GOOS=darwin GOARCH=arm64 go build -o bin/terraform-provider-edge-connect_darwin_arm64
|
|
GOOS=linux GOARCH=amd64 go build -o bin/terraform-provider-edge-connect_linux_amd64
|
|
GOOS=linux GOARCH=arm64 go build -o bin/terraform-provider-edge-connect_linux_arm64
|
|
GOOS=windows GOARCH=amd64 go build -o bin/terraform-provider-edge-connect_windows_amd64.exe
|
|
|
|
# Generate documentation
|
|
docs:
|
|
@echo "Documentation should be generated using terraform-plugin-docs"
|
|
@echo "Run: go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@latest"
|
|
@echo "Then: tfplugindocs generate"
|