standard-build/scripts/setup-template.py

21 lines
559 B
Python
Raw Normal View History

2022-09-23 21:41:25 +01:00
#IMPORT
import os, sys
#FILE_READ
with open("../nginx-site-template.conf", "r") as f:
template = f.read().replace("#serverNameVar", f"{sys.argv[1]}").replace("#http://127.0.0.1:8080/", f"#ip_address")
2022-09-23 21:58:47 +01:00
#ADDITIONAL_REPLACE
2022-09-23 21:41:25 +01:00
#FILE_WRITE
with open("/etc/nginx/sites-available/#service.conf", "w") as f:
f.write(template)
2022-09-26 14:26:55 +01:00
#GET_CERT
2022-09-26 19:07:09 +01:00
os.system(f"sh ../getcert.sh {sys.argv[1]} {sys.argv[2]}")
2022-09-26 14:26:55 +01:00
2022-09-23 21:41:25 +01:00
#GENERATE_NGINX
# depreceated, TODO: replace with os.subprocess
os.system("sh ../nginx-ensite.sh #service")
#START_CONTAINER
os.system("sh launch-docker.sh")