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

QoL improvements for working on or self-hosting image #381

Merged
merged 7 commits into from
Dec 9, 2023

Conversation

ajhodgson
Copy link
Contributor

@ajhodgson ajhodgson commented Nov 21, 2023

This does not change the default behaviour of make.

  1. Substantially reduces the size of the Makefile with macros.

  2. Allows overriding VERSION and NAME during build to easily build, tag, and upload to a custom repository, without editing the Makefile or manually creating tags after build.

  3. Allows building for only a single architecture without editing the Makefile .

Adds support for the following environment variables during make:

VERSION (if set, this overrides the VERSION set in Makefile)
NAME (if set, this overrides the repository and image base name set in Makefile)
BUILD_AMD64 (if this exists and is set to 0, the amd64 images will not be built)
BUILD_ARM64 (if this exists and is set to 0, the arm64 images will not be built)

... make sure these are not set in your environment if you don't want to change the default behaviour of make.

example build with this Makefile:

VERSION=2.6.0.1 BUILD_ARM64=0 NAME="MYAWSACCOUNT.dkr.ecr.us-west-2.amazonaws.com/passenger" make -j1 build_customizable build_ruby32 push_customizable push_ruby32

@ajhodgson ajhodgson changed the title QOL improvements for working on or self-hosting image QoL improvements for working on or self-hosting image Nov 21, 2023
@CamJN
Copy link
Member

CamJN commented Dec 8, 2023

I like the idea, but the makefile is getting pretty long and this would make it that little bit longer. Do you have any ideas how the makefile could be DRYed up a bit? I feel like there must be some way to get make to do this without having so many nearly identical rules.

@ajhodgson
Copy link
Contributor Author

I like the idea, but the makefile is getting pretty long and this would make it that little bit longer. Do you have any ideas how the makefile could be DRYed up a bit? I feel like there must be some way to get make to do this without having so many nearly identical rules.

I definitely agree and had it in the back of my mind to look at this in the future. I was able to DRY it up more than a bit after leveling up my Makefile knowledge this morning.

Tested quite a bit today, but I'd highly recommend you make sure it still does what you need it to do.

It should still work the same as before.

@CamJN
Copy link
Member

CamJN commented Dec 9, 2023

Oh wow, that's fantastic! I've started testing now.

@CamJN CamJN merged commit 6f3f9ae into phusion:master Dec 9, 2023
8 checks passed
@ajhodgson ajhodgson deleted the conditional-arch-build branch December 10, 2023 01:26
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.

2 participants