-
Notifications
You must be signed in to change notification settings - Fork 5
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
Migrate Makefile to Magefile #160
Conversation
4f1ec19
to
1eac70b
Compare
Codecov Report
@@ Coverage Diff @@
## main #160 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 1 1
Lines 67 67
=====================================
Misses 67 67 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
706d939
to
9e9eb98
Compare
LGTM! 🙌 |
13df4cd
to
2b3f5ca
Compare
Signed-off-by: Zsolt Rappi <[email protected]>
Signed-off-by: Stephen Augustus <[email protected]>
5264d39
to
c3635b0
Compare
Signed-off-by: Stephen Augustus <[email protected]>
Signed-off-by: Stephen Augustus <[email protected]>
Signed-off-by: Stephen Augustus <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvement, @rappizs!
I've built on this PR a bit to integrate some patterns from some of the Kubernetes RelEng repos:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the refactoring @justaugustus!
I found some minor issues with the final code, could you please take a look at them? Should we create an issue for it or is it ok if I just create a PR for fixing them?
coverProfileFilename = "unit-coverage.out" | ||
) | ||
|
||
// All runs all targets for this repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description is a little bit misleading, since we only run two targets not all of them
} | ||
|
||
// getBuildDateTime gets the build date and time | ||
func getBuildDateTime() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This func is not used anywhere
} | ||
|
||
// getGitState gets the state of the git repository | ||
func getGitState() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This func is not used anywhere
OS="${PLATFORM%/*}" | ||
ARCH=$(basename "$PLATFORM") | ||
|
||
output_name=bom'-'$OS'-'$ARCH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe bom
is just a copy mistake from https://github.com/kubernetes-sigs/bom/blob/main/scripts/verify-build.sh, this should be gh-jira-issue-sync
or something like that.
} | ||
|
||
// Build runs go build | ||
func Build() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build doesn't work on OSX, created an issue for it: #166
fi | ||
|
||
echo "Building project for $PLATFORM" | ||
CGO_ENABLED=0 GOARCH="$ARCH" GOOS="$OS" go build -trimpath -ldflags "${GHJIRA_LDFLAGS}" -o output/$output_name ./main.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output
dir is not included in the .gitignore file: #167
* feat(mage): Replace make with * magefile: Adopt patterns from Kubernetes Release Engineering repos --------- Signed-off-by: Zsolt Rappi <[email protected]> Co-authored-by: Stephen Augustus <[email protected]> Signed-off-by: matewolf <[email protected]>
* feat(mage): Replace make with * magefile: Adopt patterns from Kubernetes Release Engineering repos --------- Signed-off-by: Zsolt Rappi <[email protected]> Co-authored-by: Stephen Augustus <[email protected]> Signed-off-by: matewolf <[email protected]>
Migrated
make
tomage
Fixes #61