-
Notifications
You must be signed in to change notification settings - Fork 230
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
makefile support for arm64 packaging #481
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,9 @@ release: | |
@echo Releasing $(NAME) $(VERSION) | ||
hub release create v$(VERSION) \ | ||
-a packaging/output/systemd/faktory_$(VERSION)-$(ITERATION)_amd64.deb \ | ||
-a packaging/output/systemd/faktory_$(VERSION)-$(ITERATION)_arm64.deb \ | ||
-a packaging/output/systemd/faktory-$(VERSION)-$(ITERATION).x86_64.rpm \ | ||
-a packaging/output/systemd/faktory-$(VERSION)-$(ITERATION).aarch64.rpm \ | ||
-a packaging/output/systemd/faktory-ent_$(VERSION).macos.arm64.tbz \ | ||
-a packaging/output/systemd/faktory-ent_$(VERSION).macos.amd64.tbz \ | ||
-F /tmp/release-notes.md -e -o || : | ||
|
@@ -104,7 +106,12 @@ cover: | |
xbuild: clean generate | ||
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $(NAME) cmd/faktory/daemon.go | ||
# brew install upx | ||
upx -qq ./faktory | ||
upx -qq ./$(NAME) | ||
|
||
xbuild_arm64: clean generate | ||
@CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o $(NAME) cmd/faktory/daemon.go | ||
# brew install upx | ||
upx -qq ./$(NAME) | ||
|
||
build: clean generate | ||
go build -o $(NAME) cmd/faktory/daemon.go | ||
|
@@ -133,14 +140,20 @@ fmt: ## Format the code | |
work: ## Run a simple Ruby worker, see also "make run" | ||
cd test/ruby && bundle exec faktory-worker -v -r ./app.rb -q critical -q default -q bulk | ||
|
||
clean: ## Clean the project, set it up for a new build | ||
clean_project: ## Clean the project, set it up for a new build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs a better name, clean and clean_project is just confusing. |
||
@rm -rf tmp | ||
@rm -f main faktory templates.go | ||
@mkdir -p tmp/linux | ||
@go clean -testcache | ||
|
||
clean: | ||
@rm -rf tmp | ||
@rm -f main faktory templates.go | ||
@rm -f main faktory templates.go | ||
@mkdir -p tmp/linux | ||
@go clean -testcache | ||
@rm -rf packaging/output | ||
@mkdir -p packaging/output/upstart | ||
@mkdir -p packaging/output/systemd | ||
@mkdir -p tmp/linux | ||
@go clean -testcache | ||
|
||
run: clean generate ## Run Faktory daemon locally | ||
FAKTORY_PASSWORD=${PASSWORD} go run cmd/faktory/daemon.go -l debug -e development | ||
|
@@ -153,7 +166,11 @@ ussh: | |
|
||
# gem install fpm | ||
# Packaging uses Go's cross compile + fpm so we can build Linux packages on macOS. | ||
package: clean xbuild deb rpm | ||
|
||
package: clean deb rpm clean_project deb_arm64 rpm_arm64 | ||
|
||
package_base_name: | ||
@echo $(BASENAME) | ||
|
||
version_check: | ||
@grep -q $(VERSION) client/faktory.go || (echo VERSIONS OUT OF SYNC && false) | ||
|
@@ -183,6 +200,22 @@ rpm: xbuild | |
faktory=/usr/bin/faktory \ | ||
packaging/root/=/ | ||
|
||
rpm_arm64: xbuild_arm64 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be part of rpm, not a separate target. |
||
fpm -s dir -t rpm -n $(NAME) -v $(VERSION) -p packaging/output/systemd \ | ||
--depends redis \ | ||
--rpm-compression bzip2 \ | ||
--rpm-os linux \ | ||
--after-install packaging/scripts/postinst.rpm.systemd \ | ||
--before-remove packaging/scripts/prerm.rpm.systemd \ | ||
--after-remove packaging/scripts/postrm.rpm.systemd \ | ||
--url https://contribsys.com/faktory \ | ||
--description "Background job server" \ | ||
-m "Contributed Systems LLC <[email protected]>" \ | ||
--iteration $(ITERATION) --license "GPL 3.0" \ | ||
--vendor "Contributed Systems" -a arm64 \ | ||
faktory=/usr/bin/faktory \ | ||
packaging/root/=/ | ||
|
||
deb: xbuild | ||
fpm -s dir -t deb -n $(NAME) -v $(VERSION) -p packaging/output/systemd \ | ||
--depends redis-server \ | ||
|
@@ -199,6 +232,22 @@ deb: xbuild | |
faktory=/usr/bin/faktory \ | ||
packaging/root/=/ | ||
|
||
deb_arm64: xbuild_arm64 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. |
||
fpm -s dir -t deb -n $(NAME) -v $(VERSION) -p packaging/output/systemd \ | ||
--depends redis-server \ | ||
--deb-priority optional --category admin \ | ||
--no-deb-no-default-config-files \ | ||
--after-install packaging/scripts/postinst.deb.systemd \ | ||
--before-remove packaging/scripts/prerm.deb.systemd \ | ||
--after-remove packaging/scripts/postrm.deb.systemd \ | ||
--url https://contribsys.com/faktory \ | ||
--description "Background job server" \ | ||
-m "Contributed Systems LLC <[email protected]>" \ | ||
--iteration $(ITERATION) --license "GPL 3.0" \ | ||
--vendor "Contributed Systems" -a arm64 \ | ||
faktory=/usr/bin/faktory \ | ||
packaging/root/=/ | ||
|
||
tag: | ||
git tag v$(VERSION) && git push --tags || : | ||
|
||
|
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 should not be a separate target. xbuild should build both.
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.
but they have the same name...
I can put them in a separte folder, perhaps a subfolder in the output folder?
Is cleaning between arch builds required?
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.
Arch subfolders seems fine.