Add flame
This commit is contained in:
parent
79cee1b8e1
commit
8817ddba0a
10 changed files with 100 additions and 0 deletions
54
ressources/flame/debmaker
Executable file
54
ressources/flame/debmaker
Executable file
|
@ -0,0 +1,54 @@
|
|||
#!/bin/bash
|
||||
|
||||
VERSION=2.3.0
|
||||
|
||||
[ -e ./lib/function.sh ] && source ./lib/function.sh
|
||||
|
||||
APP=flame
|
||||
DEPOT=https://github.com/pawelmalak/flame.git
|
||||
GIT_VERSION=v${VERSION}
|
||||
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
|
||||
DEBIAN_VERSION_CODENAME=bullseye
|
||||
IMAGE_SIZE=3
|
||||
|
||||
STEP="envinit prebuild build makedeb"
|
||||
|
||||
envinit() {
|
||||
apt-get update
|
||||
if [ $(dpkg -l | grep -e 'ii nodejs ' | wc -l) -eq 1 ];
|
||||
then
|
||||
apt-get dist-upgrade -y
|
||||
else
|
||||
apt install -y --no-install-recommends git wget ca-certificates dpkg fakeroot build-essential nodejs npm
|
||||
fi
|
||||
}
|
||||
|
||||
prebuild(){
|
||||
[ -e /tmp/git ] && rm -fr /tmp/git
|
||||
[ -e /tmp/${APP} ] || mkdir /tmp/${APP}
|
||||
git clone --depth 1 -b ${GIT_VERSION} ${DEPOT} /tmp/git
|
||||
cp -r /tmp/git/. /tmp/${APP}
|
||||
}
|
||||
|
||||
build() {
|
||||
cd /tmp/${APP}/
|
||||
npm install mkdirp
|
||||
npm run dev-init
|
||||
cd client
|
||||
npm run build
|
||||
rm -fr ../public/*
|
||||
mv build/* ../public/
|
||||
}
|
||||
|
||||
makedeb(){
|
||||
PATH_DEB=/tmp/src/rootfs
|
||||
|
||||
cp -fr /tmp/${APP}/* ${PATH_DEB}/usr/share/flame/
|
||||
mv ${PATH_DEB}/usr/share/flame/data ${PATH_DEB}/var/lib/${APP}/data
|
||||
mv ${PATH_DEB}/usr/share/flame/public ${PATH_DEB}/var/lib/${APP}/public
|
||||
ln -fs /var/lib/${APP}/data ${PATH_DEB}/usr/share/${APP}/data
|
||||
ln -fs /var/lib/${APP}/public ${PATH_DEB}/usr/share/${APP}/public
|
||||
|
||||
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
|
||||
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
|
||||
}
|
0
ressources/flame/rootfs/DEBIAN/changelog
Normal file
0
ressources/flame/rootfs/DEBIAN/changelog
Normal file
1
ressources/flame/rootfs/DEBIAN/conffiles
Normal file
1
ressources/flame/rootfs/DEBIAN/conffiles
Normal file
|
@ -0,0 +1 @@
|
|||
/etc/default/flame
|
8
ressources/flame/rootfs/DEBIAN/control
Normal file
8
ressources/flame/rootfs/DEBIAN/control
Normal file
|
@ -0,0 +1,8 @@
|
|||
Package: flame
|
||||
Version: %VERSION%
|
||||
Section: base
|
||||
Priority: optional
|
||||
Architecture: all
|
||||
Depends:nodejs
|
||||
Maintainer: Thomas Legay <thomas@syngate.fr>
|
||||
Description: flame
|
5
ressources/flame/rootfs/DEBIAN/postinst
Executable file
5
ressources/flame/rootfs/DEBIAN/postinst
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
id flame &> /dev/null || useradd flame -r -s /bin/false
|
||||
|
||||
chown -R flame:flame /var/lib/flame
|
5
ressources/flame/rootfs/etc/default/flame
Normal file
5
ressources/flame/rootfs/etc/default/flame
Normal file
|
@ -0,0 +1,5 @@
|
|||
PORT=5005
|
||||
NODE_ENV=production
|
||||
VERSION=2.3.0
|
||||
PASSWORD=flame_password
|
||||
SECRET=e02eb43d69953658c6d07311d6313f2d4467672cb881f96b29368ba1f3f4da4b
|
13
ressources/flame/rootfs/usr/lib/systemd/system/flame.service
Normal file
13
ressources/flame/rootfs/usr/lib/systemd/system/flame.service
Normal file
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=Flame server
|
||||
After=multi-user.target
|
||||
|
||||
[Service]
|
||||
User=flame
|
||||
Group=flame
|
||||
EnvironmentFile=/etc/default/flame
|
||||
ExecStart=/usr/bin/node server.js
|
||||
WorkingDirectory=/usr/share/flame
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
0
ressources/flame/rootfs/usr/share/flame/.gitkeep
Normal file
0
ressources/flame/rootfs/usr/share/flame/.gitkeep
Normal file
0
ressources/flame/rootfs/var/lib/flame/.gitkeep
Normal file
0
ressources/flame/rootfs/var/lib/flame/.gitkeep
Normal file
Loading…
Add table
Add a link
Reference in a new issue