-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJustfile
More file actions
81 lines (62 loc) · 2.41 KB
/
Justfile
File metadata and controls
81 lines (62 loc) · 2.41 KB
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
72
73
74
75
76
77
78
79
80
81
# Project command runner (replaces Makefile for most targets).
# See: https://just.systems/man/en/
# Load .env so CY_ORG, CY_API_URL, CY_API_KEY etc. are available.
set dotenv-load := true
# Export Terraform provider env vars for plan/apply/destroy (from .env or CY_*)
export TF_VAR_cycloid_org := env("CY_ORG", "")
export TF_VAR_cycloid_api_url := env("CY_API_URL", "")
export TF_VAR_cycloid_api_key := env("CY_API_KEY", "")
# Show this help (default recipe)
[default]
help:
@just --list
# Build the provider
build *args:
go build -gcflags 'all=-l' -trimpath {{ args }}
# Run unit tests only (no TF_ACC; acceptance tests are skipped)
test-unit:
go test ./... -v -short
# Run all tests including acceptance (requires CY_API_URL, CY_API_KEY, CY_ORG)
test-acc:
TF_ACC=1 go test ./... -v
# Run a single acceptance test by name (e.g. just test-acc-one TestAccProjectResource)
test-acc-one TEST:
TF_ACC=1 go test -v -run '^{{ TEST }}$' ./provider/...
# Run unit tests (default; use test-acc for acceptance tests)
test: test-unit
# Convert swagger
convert-swagger:
go run ./swagger_converter exec
# Regenerate provider spec and models (run convert-swagger first)
tf-generate:
# Some datasources / credentials have separate codegen scripts
./datasource_credential/gen.sh
./datasource_credentials/gen.sh
./datasource_stacks/gen.sh
./resource_catalog_repository/gen.sh
tfplugingen-framework generate resources --input ./out_code_spec.json --output .
tfplugingen-framework generate data-sources --input ./out_code_spec.json --output .
# Install codegen and doc tools
install:
go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
# Install the provider binary
install-provider:
go install .
# Run terraform plan (requires install-provider and CY_* in .env)
plan: install-provider
terraform plan
# Run terraform apply -auto-approve
apply: install-provider
terraform apply -auto-approve
# Run terraform destroy -auto-approve
destroy: install-provider
terraform destroy -auto-approve
# Generate provider docs
docs:
tfplugindocs generate --examples-dir examples/ --provider-dir . --provider-name cycloid ./..
# Replace the line below with your usual playground command (e.g. terraform plan, apply, or a script).
playground:
terraform plan
# Watch and re-run playground on file changes
watch:
watchexec -w . -w justfile -e tf -e sh -e go -c -r -- just playground