new services + new scripts

This commit is contained in:
2022-10-14 18:49:09 +02:00
parent 8866784d49
commit 5538a042df
23 changed files with 200 additions and 126 deletions

12
scripts/build.py Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/python
import os
import json
apps = json.load(open('apps.json'))['apps']
print(len(apps), 'apps:', apps)
for app in apps:
os.chdir(app)
os.system('npm run build')
os.chdir('..')

20
scripts/deploy.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
useradd node -md /home/node -s /usr/sbin/nologin
python3 scripts/install.py
python3 scripts/build.py
rm -r /var/www/html/*
mv www/public/* /var/www/html
mv api/api.service /etc/systemd/system
systemctl daemon-reload
systemctl enable api
systemctl stop api
mkdir /home/node/app
rm -r /home/node/app/*
mv api/dist /home/node/app
mv api/node_modules /home/node/app
systemctl start api

12
scripts/install.py Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/python
import os
import json
apps = json.load(open('apps.json'))['apps']
print(len(apps), 'apps:', apps)
for app in apps:
os.chdir(app)
os.system('npm ci')
os.chdir('..')

12
scripts/prettier.py Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/python
import os
import json
apps = json.load(open('apps.json'))['apps']
print(len(apps), 'apps:', apps)
for app in apps:
os.chdir(app)
os.system('npm run prettier')
os.chdir('..')