Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for v6.0.3 Patch #2766

Merged
merged 5 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
38 changes: 24 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,26 @@ 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: patch_upstream
build_dotnet: upstream
pulumictl get version --language dotnet
$(WORKING_DIR)/bin/$(TFGEN) dotnet --overlays provider/overlays/dotnet --out sdk/dotnet/
cd sdk/dotnet/ && \
echo "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17" > go.mod && \
echo "$(DOTNET_VERSION)" >version.txt && \
dotnet build /p:Version=$(DOTNET_VERSION)

build_go: patch_upstream
build_go: upstream
$(WORKING_DIR)/bin/$(TFGEN) go --overlays provider/overlays/go --out sdk/go/

build_java: PACKAGE_VERSION := $(shell pulumictl get version --language generic)
build_java: bin/pulumi-java-gen patch_upstream
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/ && \
echo "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17" > go.mod && \
gradle --console=plain build

build_nodejs: VERSION := $(shell pulumictl get version --language javascript)
build_nodejs: patch_upstream
build_nodejs: upstream
$(WORKING_DIR)/bin/$(TFGEN) nodejs --overlays provider/overlays/nodejs --out sdk/nodejs/
cd sdk/nodejs/ && \
echo "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17" > go.mod && \
Expand All @@ -78,7 +78,7 @@ build_nodejs: patch_upstream
sed -i.bak -e "s/\$${VERSION}/$(VERSION)/g" ./bin/package.json

build_python: PYPI_VERSION := $(shell pulumictl get version --language python)
build_python: patch_upstream
build_python: upstream
$(WORKING_DIR)/bin/$(TFGEN) python --overlays provider/overlays/python --out sdk/python/
cd sdk/python/ && \
echo "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17" > go.mod && \
Expand Down Expand Up @@ -127,7 +127,7 @@ test:
cd provider/shim && go test -v .
cd examples && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h

tfgen: install_plugins patch_upstream
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))
$(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER)
(cd provider && VERSION=$(VERSION) go generate cmd/$(PROVIDER)/main.go)
Expand All @@ -150,10 +150,16 @@ bin/pulumi-java-gen:
fi

init_upstream:
@# If the source is set, remove it. We do this since setting the source
@# when it is already set is an error.
@if [ ! -f "upstream/.git" ]; then \
echo "Initializing upstream submodule" ; \
(cd upstream && git submodule update --init && git remote add source [email protected]:hashicorp/terraform-provider-aws.git && git fetch source) ; \
fi; \
echo "Initializing upstream submodule" && \
cd upstream && \
git submodule update --init && \
(git remote rm source || true) && \
git remote add source [email protected]:hashicorp/terraform-provider-aws.git && \
git fetch source; \
fi; \

export_upstream_patches: init_upstream
ifeq ($(shell cd upstream && git rev-parse --is-shallow-repository), false)
Expand All @@ -164,14 +170,14 @@ ifeq ($(shell cd upstream && git rev-parse --is-shallow-repository), false)
git format-patch -o ../upstream-patches --minimal --no-signature HEAD...$${LAST_TAG}
endif

patch_upstream: init_upstream export_upstream_patches
@# Ensure tool is installed
upstream: init_upstream export_upstream_patches
# Ensure tool is installed
cd upstream-tools && yarn install --frozen-lockfile
@# Reset all changes in the submodule so we're starting from a clean slate
# Reset all changes in the submodule so we're starting from a clean slate
cd upstream && git checkout . && git clean -fdx
@# Apply all automated changed
# Apply all automated changes
cd upstream-tools && yarn --silent run apply
@# Check for any pending replacements
# Check for any pending replacements
cd upstream-tools && yarn --silent run check

update_upstream: init_upstream
Expand All @@ -185,3 +191,7 @@ update_upstream: init_upstream
git push origin "patched-$$TAG"

.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider test tfgen

# To better align with other bridged providers, this target has been renamed to upstream
patch_upstream: upstream
@echo "\033[1;33m'$(MAKE) $@' is deprecated, please use '$(MAKE) upstream' instead.\033[1;0m"
2 changes: 1 addition & 1 deletion examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/term v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pulumi/pulumi-terraform-bridge/v3 v3.57.0 // indirect
github.com/pulumi/pulumi-terraform-bridge/v3 v3.58.0 // indirect
github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.7-0.20230801203955-5d215c892096 // indirect
github.com/pulumi/pulumi/sdk/v3 v3.76.1 // indirect
github.com/pulumi/terraform-diff-reader v0.0.2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions examples/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2274,8 +2274,8 @@ github.com/pulumi/pulumi-terraform-bridge/pf v0.16.0 h1:0Z6cmTjb/1p2z3W4L4e7Owhm
github.com/pulumi/pulumi-terraform-bridge/pf v0.16.0/go.mod h1:XdOy385fEso7q3NuL+zAS3I1i+X47Bg01AlVD5aJRS4=
github.com/pulumi/pulumi-terraform-bridge/testing v0.0.1 h1:SCg1gjfY9N4yn8U8peIUYATifjoDABkyR7H9lmefsfc=
github.com/pulumi/pulumi-terraform-bridge/testing v0.0.1/go.mod h1:7OeUPH8rpt5ipyj9EFcnXpuzQ8SHL0dyqdfa8nOacdk=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.57.0 h1:munOxi56glme47MT8/wI29o9wrRBJrEQuwjAgm1zviI=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.57.0/go.mod h1:ykaml8e6XS/yI9JOcNZ+6gLirs6EWTB0FmjbT+JyEdU=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.58.0 h1:1vQokJDOEQQuPAsvIHoqb0x7yGflfmXYcjkHrT5tkXg=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.58.0/go.mod h1:ykaml8e6XS/yI9JOcNZ+6gLirs6EWTB0FmjbT+JyEdU=
github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.7-0.20230801203955-5d215c892096 h1:1nzT9XuyTHdcWJboYNMPPdW0B0mQdXYg8Az5tF96MXY=
github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.7-0.20230801203955-5d215c892096/go.mod h1:1pLAP9kryYta3Xrw99oh7BmxY6PYb+z2m7ENNCJMIRQ=
github.com/pulumi/pulumi/pkg/v3 v3.76.1 h1:OdQHwI2oB8Q1Es13by63QhDqIdk7Kl4w39UTrX3M44Y=
Expand Down
Loading
Loading