Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ jobs:
fail-fast: false
matrix:
go-os: [linux, freebsd]
go-arch: [i386, x86_64, aarch64]
go-arch: [i386, x86_64, aarch64, armv7l]
exclude:
- go-os: freebsd
go-arch: armv7l
needs: [get-version]
runs-on: ubuntu-latest
env:
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ jobs:
fail-fast: false
matrix:
go-os: [linux, freebsd]
go-arch: [i386, x86_64, aarch64]
go-arch: [i386, x86_64, aarch64, armv7l]
exclude:
- go-os: freebsd
go-arch: armv7l
needs: [get-version]
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -375,7 +378,7 @@ jobs:
fail-fast: false
matrix:
go-os: [linux]
go-arch: [i386, x86_64, aarch64]
go-arch: [i386, x86_64, aarch64, armv7l]
runs-on: ubuntu-latest
needs: [get-version, build, dist-linux-osx]
env:
Expand Down Expand Up @@ -608,7 +611,7 @@ jobs:
fail-fast: false
matrix:
go-os: [linux]
go-arch: [i386, x86_64, aarch64]
go-arch: [i386, x86_64, aarch64, armv7l]
runs-on: ubuntu-latest
needs: [get-version,pkg-rpm,pkg-deb]
env:
Expand Down Expand Up @@ -779,7 +782,7 @@ jobs:
fail-fast: false
matrix:
go-os: [linux]
go-arch: [i386, x86_64, aarch64]
go-arch: [i386, x86_64, aarch64, armv7l]
runs-on: ubuntu-latest
needs: [get-version,make-release]
permissions:
Expand Down
30 changes: 21 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,31 @@ endif
ifeq ($(GOARCH),aarch64)
export GOARCH := arm64
endif
ifeq ($(GOARCH),armv7l)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first you set GOARCH to arm and because of that, you need to set it back later by NODE_EXPORTER_ARCH. This doesn't make sense to me. Why not keep GOARCH as it is.
The only variable different from GOARCH is DEB_ARCH.

export GOARCH := arm
export GOARM := 7
endif

DEB_ARCH:=$(GOARCH)
ifeq ($(DEB_ARCH),386)
DEB_ARCH := i386
endif
ifeq ($(DEB_ARCH),arm)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simply check for armv7l here, then you don't have to copy multiple variables back and forth.

DEB_ARCH := armhf
endif
DEBFILE ?= snclient-$(VERSION)-$(RPM_ARCH).deb

GITBASE=github.com/consol-monitoring/snclient
BUILD_FLAGS=-ldflags "-s -w -X $(GITBASE)/pkg/snclient.Build=$(BUILD) -X $(GITBASE)/pkg/snclient.Revision=$(REVISION)"
TEST_FLAGS=-timeout=5m $(BUILD_FLAGS)

NODE_EXPORTER_ARCH:=$(GOARCH)
ifeq ($(NODE_EXPORTER_ARCH),arm)
NODE_EXPORTER_ARCH := armv7
endif

NODE_EXPORTER_VERSION=1.11.1
NODE_EXPORTER_FILE=node_exporter-$(NODE_EXPORTER_VERSION).$(GOOS)-$(GOARCH).tar.gz
NODE_EXPORTER_FILE=node_exporter-$(NODE_EXPORTER_VERSION).$(GOOS)-$(NODE_EXPORTER_ARCH).tar.gz

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all this changes are not required.

NODE_EXPORTER_URL=https://github.com/prometheus/node_exporter/releases/download/v$(NODE_EXPORTER_VERSION)

# last i386 exe is the 0.24.0
Expand Down Expand Up @@ -472,8 +484,8 @@ deb: | dist
test -f $(NODE_EXPORTER_FILE) || curl -s -L -O $(NODE_EXPORTER_URL)/$(NODE_EXPORTER_FILE)
shasum --ignore-missing -c packaging/sha256sums.txt
tar zxvf $(NODE_EXPORTER_FILE)
mv node_exporter-$(NODE_EXPORTER_VERSION).linux-$(GOARCH)/node_exporter build-deb/usr/lib/snclient/node_exporter
rm -rf node_exporter-$(NODE_EXPORTER_VERSION).linux-$(GOARCH)
mv node_exporter-$(NODE_EXPORTER_VERSION).linux-$(NODE_EXPORTER_ARCH)/node_exporter build-deb/usr/lib/snclient/node_exporter
rm -rf node_exporter-$(NODE_EXPORTER_VERSION).linux-$(NODE_EXPORTER_ARCH)

rm -rf ./build-deb/DEBIAN
cp -r ./packaging/debian ./build-deb/DEBIAN
Expand Down Expand Up @@ -523,8 +535,8 @@ rpm: | dist
test -f $(NODE_EXPORTER_FILE) || curl -s -L -O $(NODE_EXPORTER_URL)/$(NODE_EXPORTER_FILE)
shasum --ignore-missing -c packaging/sha256sums.txt
tar zxvf $(NODE_EXPORTER_FILE)
mv node_exporter-$(NODE_EXPORTER_VERSION).linux-$(GOARCH)/node_exporter snclient-$(VERSION)/node_exporter
rm -rf node_exporter-$(NODE_EXPORTER_VERSION).linux-$(GOARCH)
mv node_exporter-$(NODE_EXPORTER_VERSION).linux-$(NODE_EXPORTER_ARCH)/node_exporter snclient-$(VERSION)/node_exporter
rm -rf node_exporter-$(NODE_EXPORTER_VERSION).linux-$(NODE_EXPORTER_ARCH)

chmod 755 \
snclient-$(VERSION)/snclient \
Expand Down Expand Up @@ -560,8 +572,8 @@ apk: | dist

test -f $(NODE_EXPORTER_FILE) || curl -s -L -O $(NODE_EXPORTER_URL)/$(NODE_EXPORTER_FILE)
tar zxvf $(NODE_EXPORTER_FILE)
mv node_exporter-$(NODE_EXPORTER_VERSION).linux-$(GOARCH)/node_exporter snclient-$(VERSION)/node_exporter
rm -rf node_exporter-$(NODE_EXPORTER_VERSION).linux-$(GOARCH)
mv node_exporter-$(NODE_EXPORTER_VERSION).linux-$(NODE_EXPORTER_ARCH)/node_exporter snclient-$(VERSION)/node_exporter
rm -rf node_exporter-$(NODE_EXPORTER_VERSION).linux-$(NODE_EXPORTER_ARCH)

chmod 755 \
snclient-$(VERSION)/snclient \
Expand Down Expand Up @@ -589,9 +601,9 @@ osx: | dist
test -f $(NODE_EXPORTER_FILE) || curl -s -L -O $(NODE_EXPORTER_URL)/$(NODE_EXPORTER_FILE)
shasum --ignore-missing -c packaging/sha256sums.txt
tar zxvf $(NODE_EXPORTER_FILE)
mv node_exporter-$(NODE_EXPORTER_VERSION).darwin-$(GOARCH)/node_exporter build-pkg/usr/local/bin/node_exporter
mv node_exporter-$(NODE_EXPORTER_VERSION).darwin-$(NODE_EXPORTER_ARCH)/node_exporter build-pkg/usr/local/bin/node_exporter
chmod 755 build-pkg/usr/local/bin/node_exporter
rm -rf node_exporter-$(NODE_EXPORTER_VERSION).darwin-$(GOARCH)
rm -rf node_exporter-$(NODE_EXPORTER_VERSION).darwin-$(NODE_EXPORTER_ARCH)

cp packaging/osx/com.snclient.snclient.plist build-pkg/Library/LaunchDaemons/

Expand Down
1 change: 1 addition & 0 deletions packaging/sha256sums.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ e987428618362c2d2540a68b722bd982ef1486c9961631298f20ea8fd57d3be4 node_exporter-
4df4ec0dca5bc061c59181cfedcd8887cb5df9c710db3c4038bc51923414bc5d node_exporter-1.11.1.linux-386.tar.gz
9f5ea48e5bc7b656f8a91a32e7d7deb89f70f73dabd0d974418aca15f37d6810 node_exporter-1.11.1.linux-amd64.tar.gz
ba1886efbd76cb96b0087c695ea8d1b9cb6e8aa946c996d744e9ee16c8e3591a node_exporter-1.11.1.linux-arm64.tar.gz
661c662e566d5c68950d63f7dfd1ec46ba28858f91aeba220c32baa1d3ad7b33 node_exporter-1.11.1.linux-armv7.tar.gz

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you changed this file manually? Because it is auto-generated by make updatenodeexportersums
This make target should be adjusted as well.

Loading