From fc1ab1f2cb80b7f14f1769ca4460f3894afcc6bf Mon Sep 17 00:00:00 2001 From: Balhau Date: Fri, 5 Jul 2024 13:18:10 +0100 Subject: [PATCH] Stuff --- Makefile | 22 +++++++++++----------- example/receitas.tf | 11 ++++++++--- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index fa35f84..178468b 100644 --- a/Makefile +++ b/Makefile @@ -3,40 +3,40 @@ arch?=darwin_amd64 provider_directory=~/.terraform.d/plugins/terraform.local/balhau/receita/1.0.0/$(arch)/ .PHONY: help -help: ## Show this help. - @sed -ne 's/^\([^[:space:]]*\):.*##/\1:\t/p' $(MAKEFILE_LIST) | column -t -s $$'\t' +help: ## Show this help. + @sed -ne 's/^\([^[:space:]]*\):.*##/\1:\t/p' $(MAKEFILE_LIST) | column -t -s $$ .PHONY: clean-bin -clean-bin: ## Clean all the generated binaries +clean-bin: ## Clean all the generated binaries rm -rf bin .PHONY: clean-terraform-state -clean-terraform-state: ## Clean all the terraform state generated by terraform-init/terraform-apply +clean-terraform-state: ## Clean all the terraform state generated by terraform-init/terraform-apply rm -rf example/.terraform example/terraform.tfstate.backup example/.terraform.lock.hcl example/terraform.tfstate .PHONY: clean -clean: clean-bin clean-terraform-state ## Clean all the generated resources +clean: clean-bin clean-terraform-state ## Clean all the generated resources .PHONY: terraform-init -terraform-init: clean-terraform-state ## Execute terraform-init on example terraform directory +terraform-init: clean-terraform-state ## Execute terraform-init on example terraform directory cd example; terraform init .PHONY: terraform-apply -terraform-apply: ## Execute terraform-apply on example directory - cd example; terraform apply +terraform-apply: ## Execute terraform-apply on example directory + cd example; terraform apply -auto-approve .PHONY: build -build: ## Build binaries, both the backed dummy server as the terraform provider binary +build: ## Build binaries, both the backed dummy server as the terraform provider binary mkdir -p bin go build -o bin/terraform-provider-receita go build -o bin/backend api/backend.go .PHONY: install-provider -install-provider: ## Install provider in the terraform plugin directory +install-provider: ## Install provider in the terraform plugin directory mkdir -p $(provider_directory) cp bin/terraform-provider-receita $(provider_directory) .PHONY: run-backend -run-backend: build ## Start the backend web server +run-backend: build ## Start the backend web server bin/backend diff --git a/example/receitas.tf b/example/receitas.tf index f853fba..fcf6a23 100644 --- a/example/receitas.tf +++ b/example/receitas.tf @@ -10,13 +10,18 @@ provider "receita" { endpoint = "http://localhost:9999" } -resource "receita_receita" "receita_one" { +resource "receita_receita" "bola_carne" { name = "Bola de carne" #name = "Batata frita" author = "Maria Bacalhau" } -resource "receita_receita" "receita_two" { - name = "Bacalhau com Todos" +resource "receita_receita" "bacalhau_todos" { + name = "Bacalhau com todos" author = "Antonio Mariscada" } + +resource "receita_receita" "pato_bravo" { + name = "Pato bravo" + author = "Jose Pato" +}