Skip to content

Commit

Permalink
build: run 'make generate' in release container (#4934)
Browse files Browse the repository at this point in the history
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 <stephan.renatus@gmail.com>
  • Loading branch information
srenatus committed Jul 26, 2022
1 parent 23443da commit 7f78653
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
18 changes: 4 additions & 14 deletions Makefile
Expand Up @@ -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
Expand Down Expand Up @@ -488,22 +478,22 @@ 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
@$(DOCKER) run $(DOCKER_FLAGS) \
-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.
Expand Down
2 changes: 1 addition & 1 deletion build/gen-release-patch.sh
Expand Up @@ -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
}

Expand Down

0 comments on commit 7f78653

Please sign in to comment.