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

build: run 'make generate' in release container #4934

Conversation

srenatus
Copy link
Contributor

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.

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>
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 \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright I'll admit that I'm not proud of this. But I really kind of dislike having to manage building and tagging and pushing images for these maintenance jobs.

Ideally, we'd be using apko here, I think; but it's macos story is a bit annoying (lima); which we wouldn't have to worry about much if kontain.me just worked on it, but it kind of doesn't...

@srenatus srenatus marked this pull request as ready for review July 25, 2022 08:54
Copy link
Contributor

@philipaconrad philipaconrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was only partially able to test the changes locally (no GH token set for the Makefile), but it looks like the docker changes seem to work as intended.

I can't say I've seen the cmd.cat/<list> syntax before in a docker file. That's definitely new for me.

@srenatus
Copy link
Contributor Author

cmd.cat is https://github.com/lukaszlach/commando -- it's a bit of a weird little service, but it does the trick.

@srenatus srenatus merged commit 7f78653 into open-policy-agent:main Jul 26, 2022
@srenatus srenatus deleted the sr/release-process/dont-mess-with-workdir branch July 26, 2022 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants