add web module

(cherry picked from commit 3483d720e90a3084ce4a90ce459d33586004a068)
This commit is contained in:
Yiru Wang Mac 2021-09-06 10:38:29 +08:00 committed by openeuler-sync-bot
parent e12ee7fdda
commit 66c06e8ba2
2 changed files with 42 additions and 1 deletions

Binary file not shown.

View File

@ -1,3 +1,4 @@
#needsrootforbuild
Name: A-Ops Name: A-Ops
Version: 1.0.1 Version: 1.0.1
Release: 1 Release: 1
@ -15,6 +16,9 @@ BuildRequires: librdkafka-devel libmicrohttpd-devel
BuildRequires: python3-setuptools python3-connexion python3-werkzeug python3-libyang BuildRequires: python3-setuptools python3-connexion python3-werkzeug python3-libyang
BuildRequires: git python3-devel systemd BuildRequires: git python3-devel systemd
# build for web
BuildRequires: nodejs node-gyp npm
%description %description
The intelligent ops toolkit for openEuler The intelligent ops toolkit for openEuler
@ -132,10 +136,25 @@ Requires: python3-werkzeug python3-connexion python3-swagger-ui-bundle
python3 pakcage of gala-ragdoll python3 pakcage of gala-ragdoll
%package -n aops-web
Summary: website for A-Ops
Requires: nginx
%description -n aops-web
website for A-Ops, deployed by Nginx
%define debug_package %{nil} %define debug_package %{nil}
%prep %prep
%autosetup -n %{name}-v%{version} %autosetup -n %{name}-v%{version}
# prepare for web
pushd aops-web
npm config set registry https://mirrors.huaweicloud.com/repository/npm/
npm cache clean -f
npm install --global yarn
yarn config set registry https://repo.huaweicloud.com/repository/npm
popd
%build %build
@ -195,6 +214,11 @@ pushd gala-ragdoll
%py3_build %py3_build
popd popd
#build for aops-web
pushd aops-web
yarn build
popd
%install %install
# install for utils # install for utils
@ -247,6 +271,16 @@ pushd adoctor-cli
popd popd
# install for web
pushd aops-web
mkdir -p %{buildroot}/opt/aops_web
cp -r dist %{buildroot}/opt/aops_web/
mkdir -p %{buildroot}/%{_sysconfdir}/nginx
cp -r deploy/aops-nginx.conf %{buildroot}/%{_sysconfdir}/nginx/
mkdir -p %{buildroot}/usr/lib/systemd/system
cp -r deploy/aops-web.service %{buildroot}/usr/lib/systemd/system/
popd
#install for gala-gopher #install for gala-gopher
pushd gala-gopher pushd gala-gopher
install -d %{buildroot}/opt/gala-gopher install -d %{buildroot}/opt/gala-gopher
@ -392,10 +426,16 @@ fi
%{python3_sitelib}/ragdoll-*.egg-info %{python3_sitelib}/ragdoll-*.egg-info
%files -n aops-web
%attr(0755, root, root) /opt/aops_web/dist/*
%attr(0755, root, root) %{_sysconfdir}/nginx/aops-nginx.conf
%attr(0755, root, root) %{_unitdir}/aops-web.service
%changelog %changelog
* Mon Sep 6 2021 Lostwayzxc<luoshengwei@huawei.com> - 1.0.1-1 * Mon Sep 6 2021 Lostwayzxc<luoshengwei@huawei.com> - 1.0.1-1
- update src, add intelligent check and diagnosis module - update src, add intelligent check and diagnosis module, and
- add web of the aops
* Thu Sep 2 2021 zhaoyuxing<zhaoyuxsing2@huawei.com> - 1.0.0-4 * Thu Sep 2 2021 zhaoyuxing<zhaoyuxsing2@huawei.com> - 1.0.0-4
- add service file in gala-spider - add service file in gala-spider
@ -409,3 +449,4 @@ fi
* Sat Jul 31 2021 orange-snn<songnannan2@huawei.com> - 1.0.0-1 * Sat Jul 31 2021 orange-snn<songnannan2@huawei.com> - 1.0.0-1
- Package init - Package init