Skip to content

Commit

Permalink
Add ARM64 binary and package builds
Browse files Browse the repository at this point in the history
  • Loading branch information
bernd committed Oct 11, 2023
1 parent abe7994 commit 73cdb9d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test: ## Run tests
build: ## Build sidecar binary for local target system
$(GO) build $(BUILD_OPTS) -v -o graylog-sidecar

build-all: build-linux-armv7 build-linux build-linux32 build-windows build-windows32 build-darwin build-darwin-arm64 build-freebsd
build-all: build-linux-armv7 build-linux-arm64 build-linux build-linux32 build-windows build-windows32 build-darwin build-darwin-arm64 build-freebsd

build-linux: ## Build sidecar binary for Linux
@mkdir -p build/$(COLLECTOR_VERSION)/linux/amd64
Expand All @@ -55,6 +55,10 @@ build-linux-armv7: ## Build sidecar binary for linux-armv7
@mkdir -p build/$(COLLECTOR_VERSION)/linux/armv7
GOOS=linux GOARCH=arm GOARM=7 $(GO) build $(BUILD_OPTS) -pkgdir $(GOPATH)/go_linux-armv7 -v -o build/$(COLLECTOR_VERSION)/linux/armv7/graylog-sidecar

build-linux-arm64: ## Build sidecar binary for linux-arm64
@mkdir -p build/$(COLLECTOR_VERSION)/linux/arm64
GOOS=linux GOARCH=arm64 $(GO) build $(BUILD_OPTS) -pkgdir $(GOPATH)/go_linux-arm64 -v -o build/$(COLLECTOR_VERSION)/linux/arm64/graylog-sidecar

build-solaris: solaris-sigar-patch ## Build sidecar binary for Solaris/OmniOS/Illumos
@mkdir -p build/$(COLLECTOR_VERSION)/solaris/amd64
GOOS=solaris GOARCH=amd64 $(GO) build $(BUILD_OPTS) -v -o build/$(COLLECTOR_VERSION)/solaris/amd64/graylog-sidecar
Expand Down Expand Up @@ -99,7 +103,7 @@ sign-binary-windows-386:
install-goversioninfo:
go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest

package-all: prepare-package package-linux-armv7 package-linux package-linux32 package-windows package-tar
package-all: prepare-package package-linux-armv7 package-linux-arm64 package-linux package-linux32 package-windows package-tar

prepare-package:
dist/fetch_collectors.sh
Expand All @@ -110,6 +114,12 @@ package-linux-armv7: ## Create Linux ARMv7 system package
fpm-cook -t deb package dist/recipearmv7.rb
fpm-cook -t rpm package dist/recipearmv7.rb

package-linux-arm64: ## Create Linux ARM64 system package
fpm-cook clean dist/recipearm64.rb
rm -rf dist/cache dist/tmp-build dist/tmp-dest
fpm-cook -t deb package dist/recipearm64.rb
fpm-cook -t rpm package dist/recipearm64.rb

package-linux: ## Create Linux amd64 system package
fpm-cook clean dist/recipe.rb
rm -rf dist/cache dist/tmp-build dist/tmp-dest
Expand Down
32 changes: 32 additions & 0 deletions dist/recipearm64.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
require_relative 'tools'

class GraylogSidecar < FPM::Cookery::Recipe
description 'Graylog collector sidecar'

name 'graylog-sidecar'
version data.version
revision data.revision
homepage 'https://graylog.org'
arch 'arm64'

source "file:../../build/#{version}/linux/arm64/graylog-sidecar"

maintainer 'Graylog, Inc. <hello@graylog.org>'
vendor 'graylog'
license 'SSPL'

config_files '/etc/graylog/sidecar/sidecar.yml'

fpm_attributes rpm_os: 'linux'

def build
end

def install
bin.install 'graylog-sidecar'
etc('graylog/sidecar').install '../../../sidecar-example.yml', 'sidecar.yml'
var('lib/graylog-sidecar/generated').mkdir
var('log/graylog-sidecar').mkdir
var('run/graylog-sidecar').mkdir
end
end

0 comments on commit 73cdb9d

Please sign in to comment.