Package init

(cherry picked from commit 61c1554ad960bcc83e418c7f7aab3db281e8d9d6)
This commit is contained in:
jxy_git 2023-09-01 17:54:21 +08:00 committed by openeuler-sync-bot
parent 0a6c7b826a
commit 9c5013d9ec
3 changed files with 67 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,67 @@
%define debug_package %{nil}
Name: PilotGo-plugin-prometheus
Version: 1.0.1
Release: 1
Summary: PilotGo prometheus plugin provides cluster monitor and alert.
License: MulanPSL-2.0
URL: https://gitee.com/openeuler/PilotGo-plugin-prometheus
Source0: https://gitee.com/openeuler/%{name}-%{version}.tar.gz
# Web packaged from 822e454fdad9bb41a83640d297ad055e1c30af26
Source1: PilotGo-plugin-prometheus-web.tar.gz
BuildRequires: systemd
BuildRequires: golang
Requires: prometheus2
Requires: golang-github-prometheus-node_exporter
Provides: pilotgo-plugin-prometheus = %{version}-%{release}
%description
PilotGo prometheus plugin provides cluster monitor and alert.
%prep
%autosetup -p1 -n %{name}-%{version}
tar -xzvf %{SOURCE1}
%build
cd server
GO111MODULE=on go build -mod=vendor -o PilotGo-plugin-prometheus main.go
%install
mkdir -p %{buildroot}/opt/PilotGo/plugin/prometheus/{server/{scripts,log},web/dist}
install -D -m 0755 server/PilotGo-plugin-prometheus %{buildroot}/opt/PilotGo/plugin/prometheus/server
install -D -m 0644 server/scripts/init_prometheus_yml.sh %{buildroot}/opt/PilotGo/plugin/prometheus/server/scripts/init_prometheus_yml.sh
install -D -m 0644 server/scripts/prometheus.yml %{buildroot}/opt/PilotGo/plugin/prometheus/server/scripts/prometheus.yml
install -D -m 0644 server/config.yml.templete %{buildroot}/opt/PilotGo/plugin/prometheus/server/config.yml
install -D -m 0644 server/scripts/PilotGo-plugin-prometheus.service %{buildroot}%{_unitdir}/PilotGo-plugin-prometheus.service
cp -rf web/dist %{buildroot}/opt/PilotGo/plugin/prometheus/web
%post
%systemd_post PilotGo-plugin-prometheus.service
%preun
%systemd_preun PilotGo-plugin-prometheus.service
%postun
%systemd_postun PilotGo-plugin-prometheus.service
%files
%dir /opt/PilotGo
%dir /opt/PilotGo/plugin
%dir /opt/PilotGo/plugin/prometheus
%dir /opt/PilotGo/plugin/prometheus/server
%dir /opt/PilotGo/plugin/prometheus/server/log
%dir /opt/PilotGo/plugin/prometheus/server/scripts
/opt/PilotGo/plugin/prometheus/server/PilotGo-plugin-prometheus
/opt/PilotGo/plugin/prometheus/server/scripts/init_prometheus_yml.sh
/opt/PilotGo/plugin/prometheus/server/scripts/prometheus.yml
/opt/PilotGo/plugin/prometheus/server/config.yml
%{_unitdir}/PilotGo-plugin-prometheus.service
/opt/PilotGo/plugin/prometheus/web/dist
%changelog
* Fri Sep 01 2023 jianxinyu <jiangxinyu@kylinos.cn> - 1.0.1-1
- Package init