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

Improve our Makefile #95

merged 4 commits into from May 17, 2019


None yet
3 participants
Copy link

commented May 14, 2019

Now that a Makefile was introduced, I tried to use it and it just didn't work at all for what I wanted to do. I made some changes that fixed the broken things, and made some non-broken things that weren't possible possible.

juliogreff added some commits May 14, 2019

Makefile: fix usage of variables
Using variables like $SHIPPER_IMAGE instead of $(SHIPPER_IMAGE) causes
errors like this:

	/bin/sh: HIPPER_IMAGE: command not found

It appears make interpolates variables like $(THIS) instead of like $THIS.
Makefile: track dependencies of shipper binaries
First of all, "shipper" is not a phony target [1]: it actually generates
a binary called "shipper". I suppose it was declared as phony so `make
shipper` would always be executed, instead of bailing out with "make:
`shipper' is up to date."

If we declare our dependencies correctly, though, it'll always execute
if the dependencies are changed, which is most likely what we actually
want, so let's do that.

Makefile: allow variables to be overridden by the environment
It's very useful to be able to override names of images and commands
executed by the Makefile during testing. I can have my own image
registry, put shipper in any namespace I want, and I can also teach it
to work with microk8s.kubectl without having to resort to symlinks :)
Makefile: depend on nested dirs inside pkg/ vendor/
Silly me, pkg/* doesn't actually go deeper than 1 level, pkg/**/* is
needed for that. Without it, modifying any files inside any directory in
pkg/ or vendor/ and then calling `make shipper` wouldn't actually result
in the task being executed.

@juliogreff juliogreff changed the title Improves our Makefile Improve our Makefile May 16, 2019

@juliogreff juliogreff requested a review from icanhazbroccoli May 16, 2019

@icanhazbroccoli icanhazbroccoli merged commit 3584fd5 into master May 17, 2019

2 checks passed

Travis CI - Branch Build Passed
Travis CI - Pull Request Build Passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.