diff --git a/PilotGo-plugin-prometheus-web.tar.gz b/PilotGo-plugin-prometheus-web.tar.gz index 6afd757e85cfac95ad2dc89b5c98f8f1dbfd3871..b16d6a546d017aa7d12a029d2d44e7bbe1252df1 100644 Binary files a/PilotGo-plugin-prometheus-web.tar.gz and b/PilotGo-plugin-prometheus-web.tar.gz differ diff --git a/PilotGo-plugin-prometheus.spec b/PilotGo-plugin-prometheus.spec index 85b164aea20fe615ae8daa119db5b5bc3dddfa01..5f057b1367aa14603f0f4e8eb6e6b62b36fa8c02 100644 --- a/PilotGo-plugin-prometheus.spec +++ b/PilotGo-plugin-prometheus.spec @@ -1,14 +1,18 @@ %define debug_package %{nil} Name: PilotGo-plugin-prometheus -Version: 1.0.1 +Version: 1.1.0 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 +Source0: https://gitee.com/openeuler/PilotGo-plugin-prometheus/repository/archive/v%{version}.tar.gz +# tar -xvf Source0 +# cd %{name}-v%{version}/web +# run 'yarn install and yarn build' in it +# tar -czvf %{name}-web.tar.gz ../web/dist/ Source1: PilotGo-plugin-prometheus-web.tar.gz + BuildRequires: systemd BuildRequires: golang Requires: prometheus2 @@ -18,22 +22,24 @@ Provides: pilotgo-plugin-prometheus = %{version}-%{release} %description PilotGo prometheus plugin provides cluster monitor and alert. - %prep -%autosetup -p1 -n %{name}-%{version} +%setup -n %{name}-v%{version} tar -xzvf %{SOURCE1} %build -cd server +pushd server GO111MODULE=on go build -mod=vendor -o PilotGo-plugin-prometheus main.go +popd %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 +pushd server +install -D -m 0755 PilotGo-plugin-prometheus %{buildroot}/opt/PilotGo/plugin/prometheus/server +install -D -m 0644 scripts/init_prometheus_yml.sh %{buildroot}/opt/PilotGo/plugin/prometheus/server/scripts/init_prometheus_yml.sh +install -D -m 0644 scripts/prometheus.yml %{buildroot}/opt/PilotGo/plugin/prometheus/server/scripts/prometheus.yml +install -D -m 0644 config.yml.templete %{buildroot}/opt/PilotGo/plugin/prometheus/server/config.yml +install -D -m 0644 scripts/PilotGo-plugin-prometheus.service %{buildroot}%{_unitdir}/PilotGo-plugin-prometheus.service +popd cp -rf web/dist %{buildroot}/opt/PilotGo/plugin/prometheus/web %post @@ -44,24 +50,21 @@ cp -rf web/dist %{buildroot}/opt/PilotGo/plugin/prometheus/web %postun %systemd_postun PilotGo-plugin-prometheus.service +# Clear all installed files when uninstalling +rm -rf /opt/PilotGo/plugin/prometheus %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 +/opt/PilotGo/plugin/prometheus/server/log +/opt/PilotGo/plugin/prometheus/web %{_unitdir}/PilotGo-plugin-prometheus.service -/opt/PilotGo/plugin/prometheus/web/dist - %changelog +* Tue Apr 02 2024 jianxinyu - 1.1.0-1 +- Update package to version 1.1.0 + * Fri Sep 01 2023 jianxinyu - 1.0.1-1 - Package init - - diff --git a/PilotGo-plugin-prometheus-1.0.1.tar.gz b/v1.1.0.tar.gz similarity index 40% rename from PilotGo-plugin-prometheus-1.0.1.tar.gz rename to v1.1.0.tar.gz index 88c1f0273739088ad5617dfa0ba7143a98769220..228452f971bf780117364a3f8541e87f198bf12a 100644 Binary files a/PilotGo-plugin-prometheus-1.0.1.tar.gz and b/v1.1.0.tar.gz differ