You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.1 KiB
32 lines
1.1 KiB
|
2 years ago
|
import subprocess
|
||
|
|
|
||
|
|
bridge_server = './packages/bridge-server'
|
||
|
|
bridge_ui = './packages/bridge-ui'
|
||
|
|
|
||
|
|
# Step 1: Shut down the NestJS server
|
||
|
|
try:
|
||
|
|
subprocess.run(['npm', 'stop'], cwd=bridge_server, check=True, shell=True)
|
||
|
|
except:
|
||
|
|
print("")
|
||
|
|
|
||
|
|
# Step 2: Shut down the Angular frontend
|
||
|
|
try:
|
||
|
|
subprocess.run(['npm', 'stop'], cwd=bridge_ui, check=True, shell=True)
|
||
|
|
except:
|
||
|
|
print("")
|
||
|
|
|
||
|
|
# Step 3: Run 'git pull' on the monorepo
|
||
|
|
subprocess.run(['git', 'pull'], cwd='./', check=True, shell=True)
|
||
|
|
|
||
|
|
# Step 4: Run 'npm install' in both projects
|
||
|
|
subprocess.run(['npm', 'install'], cwd=bridge_server, check=True, shell=True)
|
||
|
|
subprocess.run(['npm', 'install'], cwd=bridge_ui, check=True, shell=True)
|
||
|
|
|
||
|
|
# Step 5: Run 'npx sequelize-cli db:migrate' in the NestJS project
|
||
|
|
subprocess.run(['npx', 'sequelize-cli', 'db:migrate'], cwd=bridge_server, check=True, shell=True)
|
||
|
|
|
||
|
|
# Step 6: Start the NestJS server
|
||
|
|
server_process = subprocess.Popen(['npm', 'run', 'start', 'nestjs-app'], cwd=bridge_server, shell=True)
|
||
|
|
|
||
|
|
# Step 7: Start the Angular frontend
|
||
|
|
ui_process = subprocess.Popen(['ng', 'serve', '--host', '0.0.0.0'], cwd=bridge_ui, shell=True)
|