-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_pkg.sh
executable file
·47 lines (39 loc) · 1.08 KB
/
build_pkg.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
[ -z "$1" ] && echo "Provide version number like 1.0" >&2 && exit 1
set -e
#mod env
echo 'window.baseurl = "";' > src/config.js
#licenses list
#license-checker --json --out assets/licenses.json
#clean
rm -rf build
rm -rf output
rm -rf deb
mkdir -p deb/usr/local/aimpanel/app/public/panel/
#build
npm run build
cp -r assets deb/usr/local/aimpanel/app/public/panel/
cp -r build deb/usr/local/aimpanel/app/public/panel/
cp index.html deb/usr/local/aimpanel/app/public/panel/
cat > deb/afterinstall << 'EOF'
#!/bin/bash
chmod -R 750 /usr/local/aimpanel/app/public/
chown -R aimpanel:aimpanel /usr/local/aimpanel/app/public/
EOF
#make package
cd deb
fpm -s dir -t deb \
--version $1 \
--name "aimpanel-frontend" \
--description "Easy to use control panel for game servers - frontend" \
--url "http://aimpanel.pro" \
--vendor "LVL UP" \
-m "Michał Frąckiewicz <[email protected]>" \
--license "MIT" \
--after-install afterinstall \
-d aimpanel-nginx \
usr
#sign that package
dpkg-sig --sign builder *.deb
cd -
echo 'window.baseurl = "http://192.168.33.33:3131";' > src/config.js