diff --git a/Makefile b/Makefile index c5a8e9dc..17fd891f 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,8 @@ install_sdks: install_dotnet_sdk install_python_sdk install_nodejs_sdk install_j only_build: build build_dotnet: DOTNET_VERSION := $(shell pulumictl get version --language dotnet) +build_dotnet: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +build_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_dotnet: upstream pulumictl get version --language dotnet PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ @@ -38,11 +40,15 @@ build_dotnet: upstream echo "$(DOTNET_VERSION)" >version.txt && \ dotnet build /p:Version=$(DOTNET_VERSION) +build_go: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +build_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_go: upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' build_java: PACKAGE_VERSION := $(shell pulumictl get version --language generic) +build_java: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +build_java: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_java: bin/pulumi-java-gen upstream $(WORKING_DIR)/bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus cd sdk/java/ && \ @@ -50,6 +56,8 @@ build_java: bin/pulumi-java-gen upstream gradle --console=plain build build_nodejs: VERSION := $(shell pulumictl get version --language javascript) +build_nodejs: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +build_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_nodejs: upstream PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ cd sdk/nodejs/ && \ @@ -60,6 +68,8 @@ build_nodejs: upstream sed -i.bak -e "s/\$${VERSION}/$(VERSION)/g" ./bin/package.json build_python: PYPI_VERSION := $(shell pulumictl get version --language python) +build_python: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +build_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) build_python: upstream rm -rf sdk/python/ PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ @@ -93,6 +103,8 @@ install_dotnet_sdk: install_nodejs_sdk: yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin +install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) install_plugins: .pulumi/bin/pulumi lint_provider: provider @@ -111,6 +123,7 @@ provider_no_deps: provider: tfgen provider_no_deps +test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: cd examples && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h @@ -120,9 +133,11 @@ test_provider: @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) +tfgen: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +tfgen: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) tfgen: install_plugins upstream (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "-X $(PROJECT)/$(VERSION_PATH)=$(VERSION)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) - PATH=${PWD}/.pulumi/bin:$$PATH PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) + PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION) go generate cmd/$(PROVIDER)/main.go) upstream: