Skip to content

Commit 363d7b2

Browse files
author
Stepan Oksanichenko
committed
CMT-18: [End Server tools] Build node exporter from sources in cloudlinux
- Add *.spec file
1 parent 97c4075 commit 363d7b2

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

node_exporter.spec

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Group: System Environment/Base
1010
Source0: %{name}-%{version}.tar.bz2
1111
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
1212

13-
BuildRequires: golang
1413

1514
# Disable the building of the debug package(s).
1615
%define debug_package %{nil}
@@ -24,7 +23,26 @@ This package provides Node Exporter tool
2423

2524

2625
%build
27-
make
26+
# download new version of Go compiler
27+
%ifarch x86_64 amd64 ia32e
28+
wget https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz -O %{_tmppath}/go.tar.gz
29+
%else
30+
wget https://dl.google.com/go/go1.14.4.linux-386.tar.gz -O %{_tmppath}/go.tar.gz
31+
%endif
32+
tar xzf %{_tmppath}/go.tar.gz -C %{_tmppath}
33+
export PATH=$PATH:%{_tmppath}/go/bin
34+
export GOROOT=%{_tmppath}/go
35+
export GOPATH=%{_tmppath}/%{name}-%{version}-%{release}-buildroot
36+
make build
37+
rm -rf "${GOROOT}"
38+
39+
40+
%check
41+
cd "${GOPATH}"
42+
echo ">> running end-to-end tests"
43+
./end-to-end-test.sh
44+
echo ">> running end-to-end tests with unix socket"
45+
./end-to-end-test.sh -s
2846

2947

3048
%install

0 commit comments

Comments
 (0)