env + perms + tools
This commit is contained in:
@ -1,12 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
import os
|
||||
import json
|
||||
|
||||
apps: 'list[str]' = 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('..')
|
@ -2,8 +2,8 @@
|
||||
|
||||
useradd node -md /home/node -s /usr/sbin/nologin
|
||||
|
||||
python3 scripts/install.py
|
||||
python3 scripts/build.py
|
||||
python3 scripts/tools.py install
|
||||
python3 scripts/tools.py build
|
||||
|
||||
rm -r /var/www/html/*
|
||||
mv www/public/* /var/www/html
|
||||
|
@ -1,12 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
import os
|
||||
import json
|
||||
|
||||
apps: 'list[str]' = json.load(open('apps.json'))['apps']
|
||||
|
||||
print(len(apps), 'apps:', apps)
|
||||
|
||||
for app in apps:
|
||||
os.chdir(app)
|
||||
os.system('npm ci')
|
||||
os.chdir('..')
|
@ -1,12 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
import os
|
||||
import json
|
||||
|
||||
apps: 'list[str]' = 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('..')
|
32
scripts/tools.py
Executable file
32
scripts/tools.py
Executable file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/python
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
|
||||
apps = ['core', 'api', 'www']
|
||||
commands = {
|
||||
'build': 'npm run build',
|
||||
'install': 'npm ci',
|
||||
'prettier': 'npm run prettier'
|
||||
}
|
||||
|
||||
|
||||
def print_commands():
|
||||
print('Commandes disponibles: ', [c for c in commands])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) < 2:
|
||||
print_commands()
|
||||
exit()
|
||||
|
||||
cmd = sys.argv[1]
|
||||
if cmd not in commands:
|
||||
print('Commande \'%s\' non disponible' % cmd)
|
||||
print_commands()
|
||||
exit()
|
||||
|
||||
for app in apps:
|
||||
os.chdir(app)
|
||||
os.system(commands[cmd])
|
||||
os.chdir('..')
|
Reference in New Issue
Block a user