Stuff
This commit is contained in:
parent
085d1377de
commit
fc1ab1f2cb
2 changed files with 19 additions and 14 deletions
22
Makefile
22
Makefile
|
@ -3,40 +3,40 @@ arch?=darwin_amd64
|
||||||
provider_directory=~/.terraform.d/plugins/terraform.local/balhau/receita/1.0.0/$(arch)/
|
provider_directory=~/.terraform.d/plugins/terraform.local/balhau/receita/1.0.0/$(arch)/
|
||||||
|
|
||||||
.PHONY: help
|
.PHONY: help
|
||||||
help: ## Show this help.
|
help: ## Show this help.
|
||||||
@sed -ne 's/^\([^[:space:]]*\):.*##/\1:\t/p' $(MAKEFILE_LIST) | column -t -s $$'\t'
|
@sed -ne 's/^\([^[:space:]]*\):.*##/\1:\t/p' $(MAKEFILE_LIST) | column -t -s $$
|
||||||
|
|
||||||
.PHONY: clean-bin
|
.PHONY: clean-bin
|
||||||
clean-bin: ## Clean all the generated binaries
|
clean-bin: ## Clean all the generated binaries
|
||||||
rm -rf bin
|
rm -rf bin
|
||||||
|
|
||||||
.PHONY: clean-terraform-state
|
.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
|
rm -rf example/.terraform example/terraform.tfstate.backup example/.terraform.lock.hcl example/terraform.tfstate
|
||||||
|
|
||||||
.PHONY: clean
|
.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
|
.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
|
cd example; terraform init
|
||||||
|
|
||||||
.PHONY: terraform-apply
|
.PHONY: terraform-apply
|
||||||
terraform-apply: ## Execute terraform-apply on example directory
|
terraform-apply: ## Execute terraform-apply on example directory
|
||||||
cd example; terraform apply
|
cd example; terraform apply -auto-approve
|
||||||
|
|
||||||
.PHONY: build
|
.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
|
mkdir -p bin
|
||||||
go build -o bin/terraform-provider-receita
|
go build -o bin/terraform-provider-receita
|
||||||
go build -o bin/backend api/backend.go
|
go build -o bin/backend api/backend.go
|
||||||
|
|
||||||
.PHONY: install-provider
|
.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)
|
mkdir -p $(provider_directory)
|
||||||
cp bin/terraform-provider-receita $(provider_directory)
|
cp bin/terraform-provider-receita $(provider_directory)
|
||||||
|
|
||||||
.PHONY: run-backend
|
.PHONY: run-backend
|
||||||
run-backend: build ## Start the backend web server
|
run-backend: build ## Start the backend web server
|
||||||
bin/backend
|
bin/backend
|
||||||
|
|
||||||
|
|
|
@ -10,13 +10,18 @@ provider "receita" {
|
||||||
endpoint = "http://localhost:9999"
|
endpoint = "http://localhost:9999"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "receita_receita" "receita_one" {
|
resource "receita_receita" "bola_carne" {
|
||||||
name = "Bola de carne"
|
name = "Bola de carne"
|
||||||
#name = "Batata frita"
|
#name = "Batata frita"
|
||||||
author = "Maria Bacalhau"
|
author = "Maria Bacalhau"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "receita_receita" "receita_two" {
|
resource "receita_receita" "bacalhau_todos" {
|
||||||
name = "Bacalhau com Todos"
|
name = "Bacalhau com todos"
|
||||||
author = "Antonio Mariscada"
|
author = "Antonio Mariscada"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "receita_receita" "pato_bravo" {
|
||||||
|
name = "Pato bravo"
|
||||||
|
author = "Jose Pato"
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue