feat: initial copy of v0.1.0
This commit is contained in:
parent
4cc801a7f3
commit
7d4cbb6b08
538 changed files with 63361 additions and 55213 deletions
27
Makefile
27
Makefile
|
|
@ -1,5 +1,6 @@
|
|||
ROOT_DIR ?= $(shell git rev-parse --show-toplevel)
|
||||
SCRIPTS_BASE ?= $(ROOT_DIR)/scripts
|
||||
VERSION ?= ${VER}
|
||||
|
||||
# SETUP AND TOOL INITIALIZATION TASKS
|
||||
project-help:
|
||||
|
|
@ -11,21 +12,24 @@ project-tools:
|
|||
# LINT
|
||||
lint-golangci-lint:
|
||||
@echo "Linting with golangci-lint"
|
||||
@$(SCRIPTS_BASE)/lint-golangci-lint.sh
|
||||
@go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint run --fix --config .golang-ci.yaml
|
||||
|
||||
lint-tf:
|
||||
|
||||
lint-tf:
|
||||
@echo "Linting terraform files"
|
||||
@terraform fmt -check -diff -recursive
|
||||
@terraform fmt -check -diff -recursive examples/
|
||||
@terraform fmt -check -diff -recursive stackit/
|
||||
|
||||
lint: lint-golangci-lint lint-tf
|
||||
|
||||
# DOCUMENTATION GENERATION
|
||||
generate-docs:
|
||||
@echo "Generating documentation with tfplugindocs"
|
||||
|
||||
@$(SCRIPTS_BASE)/tfplugindocs.sh
|
||||
|
||||
build:
|
||||
@go build -o bin/terraform-provider-stackitalpha
|
||||
@go build -o bin/terraform-provider-stackitprivatepreview
|
||||
|
||||
fmt:
|
||||
@gofmt -s -w .
|
||||
|
|
@ -33,15 +37,16 @@ fmt:
|
|||
@terraform fmt -diff -recursive
|
||||
|
||||
# TEST
|
||||
.PHONY: test coverage
|
||||
test:
|
||||
@echo "Running tests for the terraform provider"
|
||||
@cd $(ROOT_DIR)/stackit && go test ./... -count=1 -coverprofile=coverage.out && cd $(ROOT_DIR)
|
||||
@cd $(ROOT_DIR)/stackit && go test -timeout 0 ./... -count=1 -coverprofile=../coverage.out && cd $(ROOT_DIR)
|
||||
|
||||
# Test coverage
|
||||
coverage:
|
||||
@echo ">> Creating test coverage report for the terraform provider"
|
||||
@cd $(ROOT_DIR)/stackit && (go test ./... -count=1 -coverprofile=coverage.out || true) && cd $(ROOT_DIR)
|
||||
@cd $(ROOT_DIR)/stackit && go tool cover -html=coverage.out -o coverage.html && cd $(ROOT_DIR)
|
||||
@cd $(ROOT_DIR)/stackit && (go test -timeout 0 ./... -count=1 -coverprofile=../coverage.out || true) && cd $(ROOT_DIR)
|
||||
@cd $(ROOT_DIR)/stackit && go tool cover -html=../coverage.out -o ../coverage.html && cd $(ROOT_DIR)
|
||||
|
||||
test-acceptance-tf:
|
||||
@if [ -z $(TF_ACC_PROJECT_ID) ]; then echo "Input TF_ACC_PROJECT_ID missing"; exit 1; fi
|
||||
|
|
@ -57,3 +62,11 @@ test-acceptance-tf:
|
|||
TF_ACC_REGION=$(TF_ACC_REGION) \
|
||||
go test ./... -count=1 -timeout=30m && \
|
||||
cd $(ROOT_DIR)
|
||||
|
||||
publish: build
|
||||
ifeq ($(strip $(VERSION)),)
|
||||
@echo "please call like this: VER=0.1.0 make publish"
|
||||
else
|
||||
@echo "version: $(VERSION)"
|
||||
endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue