diff --git a/.github/workflows/deploy-dev-image.yml b/.github/workflows/deploy-dev-image.yml index eb1079a..9a5d87e 100644 --- a/.github/workflows/deploy-dev-image.yml +++ b/.github/workflows/deploy-dev-image.yml @@ -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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e543514..6d30db5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 diff --git a/SS14.MapServer/BuildRunners/LocalBuildService.cs b/SS14.MapServer/BuildRunners/LocalBuildService.cs index c025254..727e2b5 100644 --- a/SS14.MapServer/BuildRunners/LocalBuildService.cs +++ b/SS14.MapServer/BuildRunners/LocalBuildService.cs @@ -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}"); } @@ -87,20 +91,25 @@ public async Task Run(string directory, string command, List 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}"); } diff --git a/SS14.MapServer/Controllers/GitHubWebhookController.cs b/SS14.MapServer/Controllers/GitHubWebhookController.cs index 9c64849..7c3da00 100644 --- a/SS14.MapServer/Controllers/GitHubWebhookController.cs +++ b/SS14.MapServer/Controllers/GitHubWebhookController.cs @@ -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 diff --git a/SS14.MapServer/SS14.MapServer.csproj b/SS14.MapServer/SS14.MapServer.csproj index 0006a54..565300b 100644 --- a/SS14.MapServer/SS14.MapServer.csproj +++ b/SS14.MapServer/SS14.MapServer.csproj @@ -5,7 +5,7 @@ enable enable Linux - 1.1.8 + 1.1.9 diff --git a/docs/Writerside/topics/Quickstart.md b/docs/Writerside/topics/Quickstart.md index 94295d1..c515556 100644 --- a/docs/Writerside/topics/Quickstart.md +++ b/docs/Writerside/topics/Quickstart.md @@ -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. @@ -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 @@ -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