This repository has been archived by the owner on Jul 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
71 lines (53 loc) · 2.1 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Makefile
NAME=terraform-provider-pingaccess
PINGACCESS_VERSION ?= 7.0.3-edge
BASE_DOCKER_TAG=pingidentity/pingaccess:${PINGACCESS_VERSION}
OS_NAME := $(shell uname -s | tr A-Z a-z)
CURDATE := ${shell date +'%y%m%d'}
pa-init:
@docker run --rm -d --hostname pingaccess --name pingaccess \
-e PING_IDENTITY_DEVOPS_KEY=$(PING_IDENTITY_DEVOPS_KEY) \
-e PING_IDENTITY_DEVOPS_USER=$(PING_IDENTITY_DEVOPS_USER) \
-e IMAGE_VERSION=pingaccess-alpine-az11-${PINGACCESS_VERSION}-${CURDATE}-b5f4 \
-e PING_IDENTITY_ACCEPT_EULA=YES \
--publish 9000:9000 ${BASE_DOCKER_TAG}
checks:
@go fmt ./...
@staticcheck ./...
@gosec ./...
@goimports -w internal
fmt:
@find ./internal/sdkv2provider -type f -name '*_test.go' | sort -u | xargs -I {} terrafmt fmt --fmtcompat {}
@find ./internal/framework -type f -name '*_test.go' | sort -u | xargs -I {} terrafmt fmt --fmtcompat {}
sweep:
@echo "WARNING: This will destroy infrastructure. Use only in development accounts."
go test ./... -v -sweep=all -timeout 60m
install:
@go install -gcflags "all=-trimpath=$GOPATH" -mod=vendor .
test-proto:
@TF_ACC=1 go test -mod=vendor ./internal/protocolprovider -v -trimpath
test-sdkv2:
@TF_ACC=1 go test -mod=vendor ./internal/sdkv2provider -v -trimpath
test:
@TF_ACC=1 go test -mod=vendor ./... -v -trimpath -coverprofile=coverage.out && go tool cover -func=coverage.out
unit-test:
@go test -mod=vendor ./... -v -trimpath
test-and-report:
@TF_ACC=1 go test -mod=vendor ./... -v -trimpath -coverprofile=coverage.out -json | tee report.json
build:
@go install -mod=vendor -trimpath .
func-init:
@rm -rf func-tests/.terraform
@rm -rf func-tests/crash.log
@rm -rf func-tests/run.log
@rm -rf func-tests/.terraform.lock.hcl
@cd func-tests && terraform init
func-plan:
@cd func-tests && TF_LOG=TRACE TF_LOG_PATH=./terraform.log terraform plan
func-apply:
@cd func-tests && TF_LOG=TRACE TF_LOG_PATH=./terraform.log terraform apply -auto-approve
func-destroy:
@cd func-tests && terraform destroy -auto-approve
func-validate:
@cd func-tests && TF_LOG=TRACE TF_LOG_PATH=./terraform.log terraform validate
.PHONY: test build deploy-local