mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-09 21:38:43 +00:00
Add systemd units, build & start production scripts to repo
This commit is contained in:
parent
0efb64cb36
commit
9486bde26c
7 changed files with 67 additions and 0 deletions
14
scripts-and-tools/build.sh
Normal file
14
scripts-and-tools/build.sh
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Build script for production
|
||||
#
|
||||
# No arguments
|
||||
# Called manually
|
||||
|
||||
cd project-lighthouse || (echo "Source directory not found, pls clone properly~" && exit 1)
|
||||
|
||||
echo "Pulling latest changes..."
|
||||
git pull
|
||||
|
||||
echo "Building..."
|
||||
dotnet build -c Release
|
||||
|
||||
exit $? # Expose error code from build command
|
4
scripts-and-tools/create-migration.sh
Executable file
4
scripts-and-tools/create-migration.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
export LIGHTHOUSE_DB_CONNECTION_STRING='server=127.0.0.1;uid=root;pwd=lighthouse;database=lighthouse'
|
||||
dotnet ef migrations add "$1" --project ProjectLighthouse
|
13
scripts-and-tools/project-lighthouse-api.service
Normal file
13
scripts-and-tools/project-lighthouse-api.service
Normal file
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=Project Lighthouse API - a clean-room, open-source custom server for LBP
|
||||
Documentation=https://github.com/LBPUnion/ProjectLighthouse
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/srv/lighthouse/start.sh API
|
||||
TimeoutStopSec=15
|
||||
User=lighthouse
|
||||
|
||||
[Install]
|
||||
Alias=lighthouse-api
|
||||
WantedBy=multi-user.target
|
13
scripts-and-tools/project-lighthouse-gameserver.service
Normal file
13
scripts-and-tools/project-lighthouse-gameserver.service
Normal file
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=Project Lighthouse GameServer - a clean-room, open-source custom server for LBP
|
||||
Documentation=https://github.com/LBPUnion/ProjectLighthouse
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/srv/lighthouse/start.sh GameServer
|
||||
TimeoutStopSec=15
|
||||
User=lighthouse
|
||||
|
||||
[Install]
|
||||
Alias=lighthouse-website
|
||||
WantedBy=multi-user.target
|
13
scripts-and-tools/project-lighthouse-website.service
Normal file
13
scripts-and-tools/project-lighthouse-website.service
Normal file
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=Project Lighthouse Website - a clean-room, open-source custom server for LBP
|
||||
Documentation=https://github.com/LBPUnion/ProjectLighthouse
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/srv/lighthouse/start.sh Website
|
||||
TimeoutStopSec=15
|
||||
User=lighthouse
|
||||
|
||||
[Install]
|
||||
Alias=lighthouse-website
|
||||
WantedBy=multi-user.target
|
13
scripts-and-tools/start.sh
Normal file
13
scripts-and-tools/start.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Startup script for production
|
||||
#
|
||||
# $1: Server to start; case sensitive!!!!!
|
||||
# Called from systemd units
|
||||
|
||||
cd "$HOME"/data || (echo "Data directory not found, pls create one~" && exit 1)
|
||||
|
||||
echo "Running..."
|
||||
|
||||
# Normally this requires ASPNETCORE_URLS but we override that in the configuration
|
||||
dotnet ../project-lighthouse/ProjectLighthouse.Servers."$1"/bin/Release/net6.0/LBPUnion.ProjectLighthouse.Servers."$1".dll
|
||||
|
||||
exit $? # Expose error code from dotnet command
|
Loading…
Add table
Add a link
Reference in a new issue