Browse Source

Single RPM version for all node versions since 6.14 (#935)

pull/1/head
rozetko 4 years ago committed by GitHub
parent
commit
bc6f26f4b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      Makefile
  2. 8
      build/rpmbuild/hastic-server.spec

20
Makefile

@ -2,26 +2,12 @@
all: rpm deb all: rpm deb
rpm_node8: rpm:
docker run --rm -it -v `pwd`/server:/root/rpmbuild/server \ docker run --rm -it -v `pwd`/server:/root/rpmbuild/server \
-v `pwd`/analytics:/root/rpmbuild/analytics \ -v `pwd`/analytics:/root/rpmbuild/analytics \
-v `pwd`/.git:/root/rpmbuild/.git \ -v `pwd`/.git:/root/rpmbuild/.git \
-v `pwd`/build/rpmbuild:/root/rpmbuild/rpm \ -v `pwd`/build/rpmbuild:/root/rpmbuild/rpm \
-v `pwd`/dist/RPMS_8:/root/rpmbuild/RPMS \ -v `pwd`/dist/RPMS:/root/rpmbuild/RPMS \
-e "NODE_VERSION=v8.0.0" \ -e "NODE_VERSION=6.14.0" \
-e "RPM_NODE_VERSION=8" \
-e "HASTIC_RELEASE_VERSION=`cat server/package.json| jq -r .version | sed 's/-/_/g'`" \ -e "HASTIC_RELEASE_VERSION=`cat server/package.json| jq -r .version | sed 's/-/_/g'`" \
hastic/rpmbuilder rpmbuild -bb rpm/hastic-server.spec 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
build/rpmbuild/hastic-server.spec

@ -1,5 +1,5 @@
%define name hastic-server %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 release 0
%define buildroot /root/rpmbuild/BUILDROOT %define buildroot /root/rpmbuild/BUILDROOT
%define builddir /root/rpmbuild/BUILD %define builddir /root/rpmbuild/BUILD
@ -61,12 +61,8 @@ popd
%install %install
mkdir -p %{buildroot}/usr/lib/hastic-server/server/dist 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 mkdir -p %{buildroot}/usr/lib/hastic-server/analytics/dist/server
cp -r server/dist %{buildroot}/usr/lib/hastic-server/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/ cp -r analytics/dist/server %{buildroot}/usr/lib/hastic-server/analytics/dist/
%post %post
@ -77,7 +73,7 @@ fi
ln -s /etc/hastic-server/config.json /usr/lib/hastic-server/config.json ln -s /etc/hastic-server/config.json /usr/lib/hastic-server/config.json
mkdir -p /var/hastic-server/ 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 echo 'node /usr/lib/hastic-server/server/dist/server' > /usr/bin/hastic-server
chmod +x /usr/bin/hastic-server chmod +x /usr/bin/hastic-server

Loading…
Cancel
Save