From 7f78653f9c0fbcfa65226e2e3feb73e727d8880d Mon Sep 17 00:00:00 2001 From: Stephan Renatus Date: Tue, 26 Jul 2022 12:43:59 +0200 Subject: [PATCH] build: run 'make generate' in release container (#4934) This replaces the docker image so that we get one that has all of these commands available: make, git, go, python2 and perl. We can now run `make generate` in the steps used to generate the release patch, so the release patch contains the builtin_metadata.json changes. Before, we had been running `make generate` in the working directory, and copied the file into the container's workdir; but that left the working directory modified, and hindered patch application before cleaning up. Signed-off-by: Stephan Renatus --- Makefile | 18 ++++-------------- build/gen-release-patch.sh | 2 +- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 8ab787bbbe..8e7243c744 100644 --- a/Makefile +++ b/Makefile @@ -168,16 +168,6 @@ clean: wasm-lib-clean fuzz: go test ./ast -fuzz FuzzParseStatementsAndCompileModules -fuzztime ${FUZZ_TIME} -v -run '^$$' -.PHONY: update-builtin-metadata-release -update-builtin-metadata-release: - build/update-version.sh "$(VERSION)" - make generate - -.PHONY: update-builtin-metadata-dev -update-builtin-metadata-dev: - build/update-version.sh "$(VERSION)-dev" - make generate - ###################################################### # # Documentation targets @@ -488,7 +478,7 @@ check-go-module: ###################################################### .PHONY: release-patch -release-patch: update-builtin-metadata-release +release-patch: ifeq ($(GITHUB_TOKEN),) @echo "\033[0;31mGITHUB_TOKEN environment variable missing.\033[33m Provide a GitHub Personal Access Token (PAT) with the 'read:org' scope.\033[0m" endif @@ -496,14 +486,14 @@ endif -e GITHUB_TOKEN=$(GITHUB_TOKEN) \ -e LAST_VERSION=$(LAST_VERSION) \ -v $(PWD):/_src \ - python:2.7 \ + cmd.cat/make/git/go/python2/perl \ /_src/build/gen-release-patch.sh --version=$(VERSION) --source-url=/_src .PHONY: dev-patch -dev-patch: update-builtin-metadata-dev +dev-patch: @$(DOCKER) run $(DOCKER_FLAGS) \ -v $(PWD):/_src \ - python:2.7 \ + cmd.cat/make/git/go/python2/perl \ /_src/build/gen-dev-patch.sh --version=$(VERSION) --source-url=/_src # Deprecated targets. To be removed. diff --git a/build/gen-release-patch.sh b/build/gen-release-patch.sh index 110b043cbe..ef93a4a3b1 100755 --- a/build/gen-release-patch.sh +++ b/build/gen-release-patch.sh @@ -77,7 +77,7 @@ update_capabilities() { } update_metadata() { - cp $SOURCE_URL/builtin_metadata.json $OPA_DIR + make generate git add --intent-to-add builtin_metadata.json }