Skip to content

Commit

Permalink
chore: fix renovate
Browse files Browse the repository at this point in the history
Hopefully this one works. Copied more of what we are doing with
pulumi-eks. Couple of things this does

1. Installs the v1 yarn (renovate container has v4 installed)
2. Installs pulumictl (copied from pulumi-eks)

I ran this inside the renovate docker container and it didn't fail, not
sure if there is a better way of testing this.

```
docker pull renovate/renovate:39-full
docker run -it -v $PWD:/usr/src/app renovate/renovate:39-full make renovate
```

re #1463
  • Loading branch information
corymhall committed Jan 6, 2025
1 parent a377e69 commit 3dd4721
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ CODEGEN_SRC := $(shell find schemagen -type f)

WORKING_DIR := $(shell pwd)

GOPATH ?= ${HOME}/go
GOBIN ?= ${GOPATH}/bin
GOPATH := $(shell go env GOPATH)
GOBIN := ${GOPATH}/bin
export GOBIN=${GOPATH}/bin
LanguageTags ?= "all"
LOCAL_PLAT ?= ""

Expand All @@ -28,7 +29,11 @@ PKG_ARGS := --no-bytecode --public-packages "*" --public
# Local & branch builds will just used this fixed default version unless specified
PROVIDER_VERSION ?= 2.0.0-alpha.0+dev
# Use this normalised version everywhere rather than the raw input to ensure consistency.
VERSION_GENERIC = $(shell pulumictl convert-version --language generic --version "$(PROVIDER_VERSION)")
VERSION_GENERIC ?= $(shell make VERSION_GENERIC=$(PROVIDER_VERSION) version_generic)
# Note recursive call to Make to auto-install pulumictl needs VERSION_GENERIC seeded to avoid infinite recursion.
PULUMICTL_VERSION := v0.0.47
PULUMICTL_BIN := $(shell which pulumictl 2>/dev/null)


GZIP_PREFIX := pulumi-resource-${PACK}-v${VERSION_GENERIC}

Expand Down Expand Up @@ -111,8 +116,8 @@ dist/${GZIP_PREFIX}-%.tar.gz::
gradle --console=plain build
@touch $@

bin/pulumi-java-gen::
$(shell pulumictl download-binary -n pulumi-language-java -v $(JAVA_GEN_VERSION) -r pulumi/pulumi-java)
bin/pulumi-java-gen: ensure-pulumictl
@$(PULUMICTL_BIN) download-binary -n pulumi-language-java -v $(JAVA_GEN_VERSION) -r pulumi/pulumi-java

.make/generate_python: bin/${CODEGEN} .make/schema README.md
rm -rf sdk/python
Expand Down Expand Up @@ -260,9 +265,26 @@ build:: provider test_provider build_sdks

dev:: lint test_provider build_nodejs

generate:: schema generate_nodejs generate_python generate_go generate_dotnet generate_java gen_types
$(HOME)/.yarn/bin:
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0

echo_path:
echo $(PATH)

renovate_generate:: PATH := $(HOME)/.yarn/bin:$(HOME)/.config/yarn/global/node_modules/.bin:$(PATH)
renovate_generate:: echo_path schema generate_nodejs generate_python generate_go generate_dotnet generate_java gen_types

renovate:: $(HOME)/.yarn/bin
renovate:: renovate_generate

ensure-pulumictl:
ifeq ($(PULUMICTL_BIN),)
@if [ ! -f "$(GOPATH)/bin/pulumictl" ]; then go install "github.com/pulumi/pulumictl/cmd/pulumictl@$(PULUMICTL_VERSION)"; fi
@$(eval PULUMICTL_BIN=$(GOPATH)/bin/pulumictl)
endif

renovate:: generate
version_generic: ensure-pulumictl
@$(PULUMICTL_BIN) convert-version --language generic --version "$(PROVIDER_VERSION)"

bin/gotestfmt:
@mkdir -p bin
Expand Down

0 comments on commit 3dd4721

Please sign in to comment.