new services + new scripts
This commit is contained in:
12
scripts/build.py
Executable file
12
scripts/build.py
Executable 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
20
scripts/deploy.sh
Executable 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
12
scripts/install.py
Executable 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
12
scripts/prettier.py
Executable 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('..')
|
Reference in New Issue
Block a user