From bc6f26f4b5c3d2870069d8758cf2698f6f324e02 Mon Sep 17 00:00:00 2001 From: rozetko Date: Tue, 13 Oct 2020 20:04:21 +0300 Subject: [PATCH] Single RPM version for all node versions since 6.14 (#935) --- Makefile | 20 +++----------------- build/rpmbuild/hastic-server.spec | 8 ++------ 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 660f52f63..6ab6cbe7b 100644 --- a/Makefile +++ b/Makefile @@ -2,26 +2,12 @@ all: rpm deb -rpm_node8: +rpm: docker run --rm -it -v `pwd`/server:/root/rpmbuild/server \ -v `pwd`/analytics:/root/rpmbuild/analytics \ -v `pwd`/.git:/root/rpmbuild/.git \ -v `pwd`/build/rpmbuild:/root/rpmbuild/rpm \ - -v `pwd`/dist/RPMS_8:/root/rpmbuild/RPMS \ - -e "NODE_VERSION=v8.0.0" \ - -e "RPM_NODE_VERSION=8" \ + -v `pwd`/dist/RPMS:/root/rpmbuild/RPMS \ + -e "NODE_VERSION=6.14.0" \ -e "HASTIC_RELEASE_VERSION=`cat server/package.json| jq -r .version | sed 's/-/_/g'`" \ hastic/rpmbuilder rpmbuild -bb rpm/hastic-server.spec - -rpm_node6: - docker run --rm -v `pwd`/server:/root/rpmbuild/server \ - -v `pwd`/analytics:/root/rpmbuild/analytics \ - -v `pwd`/.git:/root/rpmbuild/.git \ - -v `pwd`/build/rpmbuild:/root/rpmbuild/rpm \ - -v `pwd`/dist/RPMS_6:/root/rpmbuild/RPMS \ - -e "NODE_VERSION=v6.14.0" \ - -e "RPM_NODE_VERSION=6" \ - -e "HASTIC_RELEASE_VERSION=`cat server/package.json| jq -r .version | sed 's/-/_/g'`" \ - hastic/rpmbuilder rpmbuild -bb rpm/hastic-server.spec - -rpm: rpm_node8 rpm_node6 diff --git a/build/rpmbuild/hastic-server.spec b/build/rpmbuild/hastic-server.spec index 1f30129ee..aa8f90cd9 100644 --- a/build/rpmbuild/hastic-server.spec +++ b/build/rpmbuild/hastic-server.spec @@ -1,5 +1,5 @@ %define name hastic-server -%define version %{getenv:HASTIC_RELEASE_VERSION}_node%{getenv:RPM_NODE_VERSION} +%define version %{getenv:HASTIC_RELEASE_VERSION} %define release 0 %define buildroot /root/rpmbuild/BUILDROOT %define builddir /root/rpmbuild/BUILD @@ -61,12 +61,8 @@ popd %install mkdir -p %{buildroot}/usr/lib/hastic-server/server/dist -mkdir -p %{buildroot}/usr/lib/hastic-server/.git/refs/heads mkdir -p %{buildroot}/usr/lib/hastic-server/analytics/dist/server cp -r server/dist %{buildroot}/usr/lib/hastic-server/server/ -cp -r server/package.json %{buildroot}/usr/lib/hastic-server/server/ -cp -r .git/HEAD %{buildroot}/usr/lib/hastic-server/.git -cp -r .git/refs/heads/ %{buildroot}/usr/lib/hastic-server/.git/refs/ cp -r analytics/dist/server %{buildroot}/usr/lib/hastic-server/analytics/dist/ %post @@ -77,7 +73,7 @@ fi ln -s /etc/hastic-server/config.json /usr/lib/hastic-server/config.json mkdir -p /var/hastic-server/ -ln -s /usr/lib/hastic-server/data /var/hastic-server/data +ln -s /var/hastic-server/data /usr/lib/hastic-server/data echo 'node /usr/lib/hastic-server/server/dist/server' > /usr/bin/hastic-server chmod +x /usr/bin/hastic-server