Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.1.9 #27

Merged
merged 6 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/deploy-dev-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ jobs:
run: dotnet restore

- name: Build
run: dotnet build --no-restore -c Release -p:SentryOrg=sentry -p:SentryProject=ss14-map-server -p:SentryUploadSymbols=true -p:SentryUploadSources=true -p:SentryUrl=https://bugs.tanukij.dev
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
#run: dotnet build --no-restore -c Release -p:SentryOrg=sentry -p:SentryProject=ss14-map-server -p:SentryUploadSymbols=true -p:SentryUploadSources=true -p:SentryUrl=https://bugs.tanukij.dev
run: dotnet build --no-restore -c Release -p:SentryOrg=sentry -p:SentryProject=ss14-map-server
#env:
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

deploy-container:
runs-on: ubuntu-latest
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ jobs:
run: dotnet restore

- name: Build
run: dotnet build --no-restore -c Release -p:SentryOrg=sentry -p:SentryProject=ss14-map-server -p:SentryUploadSymbols=true -p:SentryUploadSources=true -p:SentryUrl=https://bugs.tanukij.dev
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
#run: dotnet build --no-restore -c Release -p:SentryOrg=sentry -p:SentryProject=ss14-map-server -p:SentryUploadSymbols=true -p:SentryUploadSources=true -p:SentryUrl=https://bugs.tanukij.dev
run: dotnet build --no-restore -c Release -p:SentryOrg=sentry -p:SentryProject=ss14-map-server
#env:
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

deploy-container:
runs-on: ubuntu-latest
Expand Down
37 changes: 23 additions & 14 deletions SS14.MapServer/BuildRunners/LocalBuildService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,17 @@ public async Task Build(string directory, CancellationToken cancellationToken =
_log.Information("Started building {ProjectName}", _configuration.MapRendererProjectName);

process.Start();
process.BeginOutputReadLine();
await process.WaitForExitAsync(cancellationToken).WaitAsync(TimeSpan.FromMinutes(_configuration.ProcessTimeoutMinutes), cancellationToken);
process.CancelOutputRead();

if (!process.HasExited)
try
{
process.Kill();
process.BeginOutputReadLine();
await process.WaitForExitAsync(cancellationToken).WaitAsync(TimeSpan.FromMinutes(_configuration.ProcessTimeoutMinutes), cancellationToken);
process.CancelOutputRead();
}
catch (OperationCanceledException)
{
if (!process.HasExited)
process.Kill();
throw new BuildException($"Building timed out {_configuration.MapRendererProjectName}");
}

Expand Down Expand Up @@ -87,20 +91,25 @@ public async Task<string> Run(string directory, string command, List<string> arg

_log.Information("Running: {Command} {Arguments}", command, string.Join(' ', arguments));

await Task.Run(() => process.Start(), cancellationToken).WaitAsync(TimeSpan.FromMinutes(1), cancellationToken);
process.Start();

if (process.HasExited)
throw new BuildException($"Run timed out {_configuration.MapRendererProjectName}");

process.BeginErrorReadLine();
process.BeginOutputReadLine();
await process.WaitForExitAsync(cancellationToken).WaitAsync(TimeSpan.FromMinutes(_configuration.ProcessTimeoutMinutes), cancellationToken);
process.CancelErrorRead();
process.CancelOutputRead();

if (!process.HasExited)
try
{
process.Kill();
process.BeginErrorReadLine();
process.BeginOutputReadLine();
await process.WaitForExitAsync(cancellationToken)
.WaitAsync(TimeSpan.FromMinutes(_configuration.ProcessTimeoutMinutes), cancellationToken);
process.CancelErrorRead();
process.CancelOutputRead();
}
catch (OperationCanceledException)
{
if (!process.HasExited)
process.Kill();

throw new BuildException($"Run timed out {_configuration.MapRendererProjectName}");
}

Expand Down
2 changes: 1 addition & 1 deletion SS14.MapServer/Controllers/GitHubWebhookController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
if (files.Count == 0)
return;

// Ensure the the ref will always just be the branch name
// Ensure the ref will always just be the branch name
var bareRef = Path.GetFileName(headCommit.Ref);

// Prevent PRs from the master branch causing issues
Expand Down Expand Up @@ -318,7 +318,7 @@
/// </summary>
public sealed class PatchedPushEventPayload : PushEventPayload
{
public string Before { get; private set; }

Check warning on line 321 in SS14.MapServer/Controllers/GitHubWebhookController.cs

View workflow job for this annotation

GitHub Actions / deploy-sentry

'PatchedPushEventPayload.Before' hides inherited member 'PushEventPayload.Before'. Use the new keyword if hiding was intended.

Check warning on line 321 in SS14.MapServer/Controllers/GitHubWebhookController.cs

View workflow job for this annotation

GitHub Actions / build

'PatchedPushEventPayload.Before' hides inherited member 'PushEventPayload.Before'. Use the new keyword if hiding was intended.
public string After { get; private set; }
public new string Ref { get; private set; }
}
2 changes: 1 addition & 1 deletion SS14.MapServer/SS14.MapServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<Version>1.1.8</Version>
<Version>1.1.9</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions docs/Writerside/topics/Quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
It also takes care of managing and hosting map images.

It's mainly used in combination with the map viewer, which lists and displays maps from a specific branch:
[https://github.com/juliangiebel/space-station-14-map-viewer](https://github.com/juliangiebel/space-station-14-map-viewer)
[https://github.com/space-wizards/ss14.mapviewer](https://github.com/space-wizards/ss14.mapviewer)

The map viewer for Official SS14 servers can be found here: [https://maps14.tanukij.dev/](https://maps14.tanukij.dev/)
The map viewer for Official SS14 servers can be found here: [https://map.spacestation14.com/](https://map.spacestation14.com/)

The map server can also post map images on PRs that modify map files. That requires setting up a Github app.

Expand Down Expand Up @@ -38,7 +38,7 @@ If you want automatic rendering and map images under PRs changing map files you'
## Setup - Docker compose

There is a docker image provided for %project-name%:
[https://github.com/juliangiebel/SS14.MapServer/pkgs/container/ss14.mapserver](https://github.com/juliangiebel/SS14.MapServer/pkgs/container/ss14.mapserver)
[https://github.com/space-wizards/SS14.MapServer/pkgs/container/ss14.mapserver](https://github.com/space-wizards/SS14.MapServer/pkgs/container/ss14.mapserver)

````yaml
# Example docker compose file
Expand All @@ -47,7 +47,7 @@ services:
# The ss14 map server container doesn't support https on its own.
# Please use a reverse proxy
ss14mapserver:
image: ghcr.io/juliangiebel/ss14.mapserver:latest
image: ghcr.io/space-wizards/ss14.mapserver:latest
volumes:
- ./appsettings.yaml:/app/appsettings.yaml
- ./private-key.pem:/app/private-key.pem
Expand Down
Loading