Skip to content

Commit

Permalink
Merge pull request #2439 from pulumi/KP/AddSchemaCheckCommand
Browse files Browse the repository at this point in the history
Adds a phony make target to check local schema against master
  • Loading branch information
kpitzen authored Mar 31, 2023
2 parents 842f081 + aa7f26e commit 1594a2a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .schema-tools.version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.3
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt

.PHONY: check_schema

PACK := aws
ORG := pulumi
PROJECT := github.com/$(ORG)/pulumi-$(PACK)
Expand All @@ -12,10 +14,25 @@ JAVA_GEN := pulumi-java-gen
JAVA_GEN_VERSION := v0.7.1
TESTPARALLELISM := 10
WORKING_DIR := $(shell pwd)
SCHEMA_TOOLS_VERSION := $(shell cat .schema-tools.version)

# Override repo path discovery because we're using a local checkout instead of the go mod
export PULUMI_REPO_PATHS=github.com/hashicorp/terraform-provider-aws=$(WORKING_DIR)/upstream

# Download local copy of schema-tools based on the version in .schema-tools.version
bin/schema-tools: SCHEMA_TOOLS_VERSION := $(shell cat .schema-tools.version)
bin/schema-tools: PLAT := $(shell go version | sed -En "s/go version go.* (.*)\/(.*)/\1-\2/p")
bin/schema-tools: SCHEMA_TOOLS_URL := "https://github.com/pulumi/schema-tools/releases/download/v$(SCHEMA_TOOLS_VERSION)/schema-tools-v$(SCHEMA_TOOLS_VERSION)-$(PLAT).tar.gz"
bin/schema-tools: .schema-tools.version
@echo "Installing schema-tools"
@mkdir -p bin
wget -q -O - "$(SCHEMA_TOOLS_URL)" | tar -xzf - -C $(WORKING_DIR)/bin schema-tools
@touch bin/schema-tools
@echo "schema-tools" $$(./bin/schema-tools version)

check_schema: bin/schema-tools
./bin/schema-tools compare -p $(PACK) -o master -n --local-path=provider/cmd/pulumi-resource-$(PACK)/schema.json

development: install_plugins provider build_sdks install_sdks

build: install_plugins provider build_sdks install_sdks
Expand Down

0 comments on commit 1594a2a

Please sign in to comment.