Skip to content

Commit

Permalink
Single RPM version for all node versions since 6.14 (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
rozetko authored Oct 13, 2020
1 parent f3e80dd commit bc6f26f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
20 changes: 3 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 2 additions & 6 deletions build/rpmbuild/hastic-server.spec
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit bc6f26f

Please sign in to comment.