forked from sensorgnome-org/sensorgnome-support
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgen-package.sh
More file actions
executable file
·34 lines (30 loc) · 1.21 KB
/
gen-package.sh
File metadata and controls
executable file
·34 lines (30 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! /bin/bash -e
DESTDIR=build-temp
rm -rf $DESTDIR
mkdir $DESTDIR
# npm install to populate modules
npm --no-fund install
DEST=$DESTDIR/opt/sensorgnome/web-portal
install -d $DEST
install -m 644 Caddyfile $DEST
install -m 755 *.sh $DEST
install -m 644 *.js *.txt *.json $DEST
cp -r node_modules $DEST
install -d $DEST/public
install -m 644 *.html $DEST/public
install -d $DESTDIR/etc/systemd/system
install -m 644 *.service $DESTDIR/etc/systemd/system
# Fetch local-ip HTTPS certs - this is duplicated in the sensorgnome image build pifile
# They also get updated from the SG Hub.
install -d $DESTDIR/etc/sensorgnome
# disabled due to demise of local-ip.co
#curl -L -o $DESTDIR/etc/sensorgnome/local-ip.key http://local-ip.co/cert/server.key
#curl -L -o $DESTDIR/etc/sensorgnome/local-ip.pem http://local-ip.co/cert/server.pem
#curl -L -o - http://local-ip.co/cert/chain.pem >> $DESTDIR/etc/sensorgnome/local-ip.pem
#chmod 644 $DESTDIR/etc/sensorgnome/local-ip.*
# Boilerplate package generation
cp -r DEBIAN $DESTDIR
sed -e "/^Version/s/:.*/: $(TZ=PST8PDT date +%Y.%j)/" -i $DESTDIR/DEBIAN/control # set version: YYYY.DDD
dpkg-deb -Zxz --root-owner-group --build $DESTDIR ../packages
# dpkg-deb --contents ../packages
ls -lh ../packages