Add systemd units, build & start production scripts to repo

This commit is contained in:
jvyden 2022-05-15 21:48:23 -04:00
parent 0efb64cb36
commit 9486bde26c
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
7 changed files with 67 additions and 0 deletions

View file

@ -14,6 +14,7 @@
<Path>create-migration.sh</Path> <Path>create-migration.sh</Path>
<Path>docker-compose.yml</Path> <Path>docker-compose.yml</Path>
<Path>global.json</Path> <Path>global.json</Path>
<Path>scripts-and-tools</Path>
</explicitIncludes> </explicitIncludes>
<explicitExcludes> <explicitExcludes>
<Path>.idea/.idea.ProjectLighthouse/.idea/workspace.xml</Path> <Path>.idea/.idea.ProjectLighthouse/.idea/workspace.xml</Path>

View 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

View 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

View 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

View 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

View 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