Skip to content

Commit

Permalink
Release v1.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangiebel authored Nov 11, 2024
2 parents f5d3794 + cc433af commit 379ce9f
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 26 deletions.
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 @@ private async Task HandlePullRequestEvent(PullRequestEventPayload payload)
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
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

0 comments on commit 379ce9f

Please sign in to comment.