diff --git a/provider-ci/internal/pkg/config.go b/provider-ci/internal/pkg/config.go index ad75c1955..ca65cd822 100644 --- a/provider-ci/internal/pkg/config.go +++ b/provider-ci/internal/pkg/config.go @@ -285,6 +285,9 @@ type Config struct { // Customizing this value allows providers implemented in Node or other languages. BuildProviderCmd string `yaml:"buildProviderCmd"` + // Customizes a hook to run right before BuildProviderCmd. + BuildProviderPre string `yaml:"buildProviderPre"` + // Customizes the Make function test_provider_cmd. // // This function is called without arguments to run unit tests for the provider binary. diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index fb6de95f8..9c92d82f9 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -256,9 +256,15 @@ lint_provider.fix: .PHONY: lint_provider lint_provider.fix #{{- if .Config.BuildProviderCmd }}# -build_provider_cmd = #{{ .Config.BuildProviderCmd }}# +build_provider_cmd = #{{ if .Config.BuildProviderPre -}}# + #{{ .Config.BuildProviderPre }}#; + #{{- end -}}# + #{{ .Config.BuildProviderCmd }}# #{{- else }}# -build_provider_cmd = cd provider && GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o "$(3)" -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) +build_provider_cmd = #{{ if .Config.BuildProviderPre -}}# + #{{ .Config.BuildProviderPre }}#; + #{{- end -}}# + cd provider && GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o "$(3)" -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) #{{- end }}# provider: bin/$(PROVIDER) diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index b8c248d2b..dfb89c174 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -251,7 +251,7 @@ test_provider: .PHONY: test_provider tfgen: schema -schema: .make/schema +schema: .make/schema # This does actually have dependencies, but we're keeping it around for backwards compatibility for now tfgen_no_deps: .make/schema .make/schema: export PULUMI_HOME := $(WORKING_DIR)/.pulumi diff --git a/provider-ci/test-providers/eks/.ci-mgmt.yaml b/provider-ci/test-providers/eks/.ci-mgmt.yaml index 23c7d95db..5df4529b1 100644 --- a/provider-ci/test-providers/eks/.ci-mgmt.yaml +++ b/provider-ci/test-providers/eks/.ci-mgmt.yaml @@ -23,3 +23,4 @@ env: PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget template: generic freeDiskSpaceBeforeTest: true # TODO: https://github.com/pulumi/pulumi/issues/17718 +buildProviderPre: echo building-provider diff --git a/provider-ci/test-providers/eks/Makefile b/provider-ci/test-providers/eks/Makefile index 36086cf9c..6f2db5017 100644 --- a/provider-ci/test-providers/eks/Makefile +++ b/provider-ci/test-providers/eks/Makefile @@ -214,7 +214,7 @@ lint_provider: provider lint_provider.fix: cd provider && golangci-lint run --path-prefix provider -c ../.golangci.yml --fix .PHONY: lint_provider lint_provider.fix -build_provider_cmd = cd provider && GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o "$(3)" -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) +build_provider_cmd = echo building-provider;cd provider && GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o "$(3)" -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) provider: bin/$(PROVIDER)