Browse Source

Add in an update script

new_auth
Dan 2 years ago
parent
commit
eabd61c020
  1. 2
      packages/bridge-ui/src/app/components/season-standings/season-standings.component.ts
  2. 32
      reboot_and_update.py

2
packages/bridge-ui/src/app/components/season-standings/season-standings.component.ts

@ -55,7 +55,7 @@ export class SeasonStandingsComponent {
return;
}
this.sortedStandings = [...this.season.standings]
this.onUpdatedStandings(this.season.standings);
console.log("Season Standings - Begin")
console.log(this.season);
console.log(this.sortedStandings);

32
reboot_and_update.py

@ -0,0 +1,32 @@
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)
Loading…
Cancel
Save