Debian package builds

Also prevent setup Ctrl+C from blocking
This commit is contained in:
Jordan
2023-06-19 05:49:51 -04:00
parent 4da221772d
commit 12706b1914
11 changed files with 142 additions and 1 deletions
+1
View File
@@ -23,3 +23,4 @@ artifacts/
release_notes.md
*nupkg
*.sqlite3
packaging/
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/make -f
install:
mkdir -p $(DESTDIR)/opt/tgstation-server
cp -r artifacts/* $(DESTDIR)/opt/tgstation-server
uninstall:
mkdir -p $(DESTDIR)/opt/tgstation-server
cp -r artifacts/* $(DESTDIR)/opt/tgstation-server/
+28
View File
@@ -0,0 +1,28 @@
#!/bin/bash
# Run from git root, assumes dotnet-sdk-6.0 is installed
dpkg --add-architecture i386
apt-get update
apt-get install -y build-essential binutils lintian debhelper dh-make devscripts xmlstarlet # needs cleanup probably, SO copypasta
CURRENT_COMMIT=$(git rev-parse HEAD)
rm -rf packaging
git worktree remove packaging
git worktree add -f packaging $CURRENT_COMMIT
cd packaging
rm -f .git
export DEBEMAIL="Cyberboss@users.noreply.github.com"
export DEBFULLNAME="Jordan Dominion"
TGS_VERSION=$(xmlstarlet sel -N X="http://schemas.microsoft.com/developer/msbuild/2003" --template --value-of /X:Project/X:PropertyGroup/X:TgsCoreVersion build/Version.props)
dh_make -p tgstation-server_$TGS_VERSION -y --createorig -s
cp build/package/deb/debian/* debian/
cp build/tgstation-server.service debian/
dpkg-buildpackage
cd ..
+27
View File
@@ -0,0 +1,27 @@
Source: tgstation-server
Section: unknown
Priority: optional
Maintainer: Jordan Dominion <Cyberboss@users.noreply.github.com>
Rules-Requires-Root: no
Build-Depends:
debhelper-compat (= 13),
dotnet-sdk-6.0,
npm,
Standards-Version: 4.6.2
Homepage: https://tgstation.github.io/tgstation-server
Vcs-Browser: https://github.com/tgstation/tgstation-server
Vcs-Git: https://github.com/tgstation/tgstation-server.git
Package: tgstation-server
Architecture: any
Depends:
${misc:Depends},
aspnetcore-runtime-6.0,
libc6-i386,
libstdc++6:i386 [amd64],
libstdc++6 [i386],
gcc-multilib [amd64],
Recommends:
gdb,
Description: A production scale tool for BYOND server management
This is a toolset to manage production BYOND servers. It includes the ability to update the server without having to stop or shutdown the server (the update will take effect on a "reboot" of the server), the ability to start the server and restart it if it crashes, as well as systems for managing code and game files, and merging GitHub Pull Requests for test deployments.
+10
View File
@@ -0,0 +1,10 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://github.com/tgstation/tgstation-server
Upstream-Name: tgstation-server
Upstream-Contact: Jordan Dominion <Cyberboss@users.noreply.github.com>
Files:
*
Copyright:
2023 Jordan Dominion <Cyberboss@users.noreply.github.com>
License: AGPL-3
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
pushd /opt/tgstation-server
dotnet /opt/tgstation-server/lib/Default/Tgstation.Server.Host.dll General:SetupWizardMode=Only
popd
#DEBHELPER#
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
#DEBHELPER#
rm -rf /opt/tgstation-server/lib/*
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/make -f
export DH_VERBOSE = 1
%:
dh $@
override_dh_auto_clean:
dotnet clean -c ReleaseNoService
override_dh_auto_build:
dotnet restore
cd src/Tgstation.Server.Host.Console && dotnet publish -c Release -o ../../artifacts
cd src/Tgstation.Server.Host && dotnet publish -c Release -o ../../artifacts/lib/Default
mv artifacts/lib/Default/appsettings.yml artifacts/appsettings.yml
rm artifacts/lib/Default/Tgstation.Server.Host
override_dh_auto_install:
cp build/package/deb/MakeInstall ./Makefile
dh_auto_install --
override_dh_strip:
override_dh_shlibdeps:
override_dh_installsystemd:
dh_installsystemd -v --name=tgstation-server --restart-after-upgrade
+4
View File
@@ -1,6 +1,10 @@
[Unit]
Description=tgstation-server
After=network.target
After=mysql.service
After=mariadb.service
After=postgresql.service
After=mssql-server.service
[Service]
ExecStart=/bin/bash /opt/tgstation-server/tgs.sh General:SetupWizardMode=Never
+4 -1
View File
@@ -3,6 +3,8 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Tgstation.Server.Host.Extensions;
namespace Tgstation.Server.Host.IO
{
/// <inheritdoc />
@@ -99,7 +101,8 @@ namespace Tgstation.Server.Host.IO
},
cancellationToken,
DefaultIOManager.BlockingTaskCreationOptions,
TaskScheduler.Current);
TaskScheduler.Current)
.WithToken(cancellationToken);
/// <inheritdoc />
public Task WriteAsync(string text, bool newLine, CancellationToken cancellationToken) => Task.Factory.StartNew(
+20
View File
@@ -199,6 +199,23 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tgstation.Server.Host.Commo
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tgstation.Server.Common", "src\Tgstation.Server.Common\Tgstation.Server.Common.csproj", "{70CD9A98-D31A-44A4-81D1-D02764CEEEFD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "package", "package", "{2648A85F-61AE-428E-95E1-66D06C7A3768}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "deb", "deb", "{457A1F89-6201-4430-BCC6-2F4438A54B9E}"
ProjectSection(SolutionItems) = preProject
build\package\deb\build_package.sh = build\package\deb\build_package.sh
build\package\deb\MakeInstall = build\package\deb\MakeInstall
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "debian", "debian", "{08E7C650-A447-4DE2-974E-ED123B50F8D6}"
ProjectSection(SolutionItems) = preProject
build\package\deb\debian\control = build\package\deb\debian\control
build\package\deb\debian\copyright = build\package\deb\debian\copyright
build\package\deb\debian\postinst = build\package\deb\debian\postinst
build\package\deb\debian\prerm = build\package\deb\debian\prerm
build\package\deb\debian\rules = build\package\deb\debian\rules
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -383,6 +400,9 @@ Global
{5813CC33-B16C-485D-A74D-20204DDF6542} = {316141B0-CD21-4769-A013-D53DA9B9EC09}
{CE499888-B22B-457C-891E-0EA9DC317228} = {A55C1117-5808-4AB2-BEA6-4D4A3E66A2F2}
{07ED0FD5-E46B-4841-931D-BA2B673E16B2} = {A55C1117-5808-4AB2-BEA6-4D4A3E66A2F2}
{2648A85F-61AE-428E-95E1-66D06C7A3768} = {6FF654E6-3E2C-46D4-872D-D528F77D6973}
{457A1F89-6201-4430-BCC6-2F4438A54B9E} = {2648A85F-61AE-428E-95E1-66D06C7A3768}
{08E7C650-A447-4DE2-974E-ED123B50F8D6} = {457A1F89-6201-4430-BCC6-2F4438A54B9E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DFD36C95-3E49-41C7-ACDB-86BAF5B18A79}