From 8ef2ba8ee75a8d495903d26ef266f7409c36b614 Mon Sep 17 00:00:00 2001 From: kongfei Date: Wed, 22 Jun 2022 16:50:32 +0800 Subject: [PATCH] build arm64v8 artifacts --- .goreleaser.yaml | 38 ++++++++++++++++++++++++++--- inputs/oracle/oracle_linux_amd64.go | 3 +++ 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index cb2d22bb..3e549826 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -15,12 +15,13 @@ builds: main: ./ binary: categraf env: - - CGO_ENABLED=1 + - CGO_ENABLED=0 goos: - linux - windows goarch: - amd64 + - arm64 ldflags: - -s -w - -X flashcat.cloud/categraf/config.Version={{ .Tag }}-{{.Commit}} @@ -44,7 +45,7 @@ release: dockers: - image_templates: - - flashcatcloud/categraf:amd64-{{ .Tag }} + - flashcatcloud/categraf:{{ .Tag }}-amd64 goos: linux goarch: amd64 ids: @@ -71,12 +72,41 @@ dockers: build_flag_templates: - "--platform=linux/amd64" + - image_templates: + - flashcatcloud/categraf:{{ .Tag }}-arm64v8 + goos: linux + goarch: arm64 + ids: + - build + dockerfile: docker/Dockerfile.goreleaser + extra_files: + - docker/entrypoint.sh + - conf/config.toml + - conf/logs.toml + - conf/input.cpu/cpu.toml + - conf/input.mem/mem.toml + - conf/input.disk/disk.toml + - conf/input.diskio/diskio.toml + - conf/input.kernel/kernel.toml + - conf/input.linux_sysctl_fs/linux_sysctl_fs.toml + - conf/input.system/system.toml + - conf/input.kernel_vmstat/kernel_vmstat.toml + - conf/input.netstat/netstat.toml + - conf/input.net/net.toml + - conf/input.docker/docker.toml + - conf/input.kubernetes/kubernetes.toml + - conf/input.processes/processes.toml + use: buildx + build_flag_templates: + - "--platform=linux/arm64/v8" docker_manifests: - name_template: flashcatcloud/categraf:{{ .Tag }} image_templates: - - flashcatcloud/categraf:amd64-{{ .Tag }} + - flashcatcloud/categraf:{{ .Tag }}-amd64 + - flashcatcloud/categraf:{{ .Tag }}-arm64v8 - name_template: flashcatcloud/categraf:latest image_templates: - - flashcatcloud/categraf:amd64-{{ .Tag }} + - flashcatcloud/categraf:{{ .Tag }}-amd64 + - flashcatcloud/categraf:{{ .Tag }}-arm64v8 diff --git a/inputs/oracle/oracle_linux_amd64.go b/inputs/oracle/oracle_linux_amd64.go index 08748d60..43059f0f 100644 --- a/inputs/oracle/oracle_linux_amd64.go +++ b/inputs/oracle/oracle_linux_amd64.go @@ -1,3 +1,6 @@ +//go:build enterpise +// +build enterpise + package oracle import (