beatrun.ru/build_and_push.py

14 lines
423 B
Python
Raw Normal View History

2024-03-17 17:04:07 +05:00
import os
import subprocess
import shlex
def shell_exec(command):
p = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).communicate()
return p[0].decode("utf-8", errors="ignore")
try:
print(shell_exec("npm run build"))
except Exception as e:
print(e)
#print(shell_exec("rsync -avhp --rsync-path=\"sudo rsync\" --chmod=a=rwX build/ steam@hvh.tf:/var/www/html/"))