feat: Create provisioner abstraction (#12)

* feat: Create provisioner abstraction

Creates a provisioner abstraction that takes prior art from the Terraform plugin system. It's safe to assume this code will change a lot when it becomes integrated with provisionerd.

Closes #10.

* Ignore generated files in diff view

* Check for unstaged file changes

* Install protoc-gen-go

* Use proper drpc plugin version

* Fix serve closed pipe

* Install sqlc with curl for speed

* Fix install command

* Format CI action

* Add linguist-generated and closed pipe test

* Cleanup code from comments

* Add dRPC comment

* Add Terraform installer for cross-platform

* Build provisioner tests on Linux only
This commit is contained in:
Kyle Carberry
2022-01-08 11:24:02 -06:00
committed by GitHub
parent 2769f4c2e0
commit 7c260f88d1
20 changed files with 1877 additions and 14 deletions
+14 -1
View File
@@ -3,11 +3,11 @@ database/dump.sql: $(wildcard database/migrations/*.sql)
go run database/dump/main.go
# Generates Go code for querying the database.
.PHONY: database/generate
database/generate: database/dump.sql database/query.sql
cd database && sqlc generate && rm db_tmp.go
cd database && gofmt -w -r 'Querier -> querier' *.go
cd database && gofmt -w -r 'Queries -> sqlQuerier' *.go
.PHONY: database/generate
fmt/prettier:
@echo "--- prettier"
@@ -21,3 +21,16 @@ endif
fmt: fmt/prettier
.PHONY: fmt
gen: database/generate provisionersdk/proto
.PHONY: gen
# Generates the protocol files.
provisionersdk/proto: provisionersdk/proto/provisioner.proto
cd provisionersdk/proto && protoc \
--go_out=. \
--go_opt=paths=source_relative \
--go-drpc_out=. \
--go-drpc_opt=paths=source_relative \
./provisioner.proto
.PHONY: provisionersdk/proto