mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-29 20:22:32 +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,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>
|
||||||
|
|
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
|
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