Fix docker build

This commit is contained in:
Jordan Dominion
2024-08-14 22:46:01 -04:00
parent 6d41ffc17b
commit 8f348595fb
3 changed files with 20 additions and 3 deletions
+11 -1
View File
@@ -424,6 +424,8 @@ jobs:
runs-on: ubuntu-latest
needs: start-ci-run-gate
if: (!(cancelled() || failure()) && needs.start-ci-run-gate.result == 'success')
env:
TGS_TELEMETRY_KEY_FILE: tgs_telemetry_key.txt
steps:
- name: Checkout (Branch)
uses: actions/checkout@v4
@@ -435,8 +437,16 @@ jobs:
with:
ref: "refs/pull/${{ github.event.number }}/merge"
- name: Setup Telemetry Key File
shell: bash
run: echo "${{ secrets.TGS_TELEMETRY_KEY }}" > ${{ env.TGS_TELEMETRY_KEY_FILE }}
- name: Build Docker Image
run: docker build . -f build/Dockerfile
run: docker build . -f build/Dockerfile --build-arg TGS_TELEMETRY_KEY_FILE=${{ env.TGS_TELEMETRY_KEY_FILE }}
- name: Delete Telemetry Key File
if: always()
run: rm ${{ env.TGS_TELEMETRY_KEY_FILE }}
linux-unit-tests:
name: Linux Tests
+8 -2
View File
@@ -1,5 +1,8 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS build
# Set in CI
ARG TGS_TELEMETRY_KEY_FILE=
# install node and npm
# replace shell with bash so we can source files
RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.39.1/install.sh | sh
@@ -17,7 +20,8 @@ RUN . $NVM_DIR/nvm.sh \
&& apt-get install -y \
dos2unix \
libgdiplus \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
&& corepack enable
# Build web control panel
WORKDIR /repo/build
@@ -45,7 +49,9 @@ RUN dotnet publish -c Release -o /app \
&& build/RemoveUnsupportedRuntimes.sh /app
WORKDIR /repo/src/Tgstation.Server.Host
RUN dotnet publish -c Release -o /app/lib/Default \
RUN export TGS_TELEMETRY_KEY_FILE="${TGS_TELEMETRY_KEY_FILE}" \
&& dotnet publish -c Release -o /app/lib/Default \
&& cd ../.. \
&& build/RemoveUnsupportedRuntimes.sh /app/lib/Default \
&& mv /app/lib/Default/appsettings* /app
@@ -60,6 +60,7 @@
</Target>
<Target Condition="'$(TGS_TELEMETRY_KEY_FILE)' != ''" Name="ApplyTelemetryAppSerializedKey" BeforeTargets="CoreCompile">
<Error Condition="!Exists('$(TGS_TELEMETRY_KEY_FILE)')" Text="TGS_TELEMETRY_KEY_FILE set but does not exist!" />
<ReadLinesFromFile
File="$(TGS_TELEMETRY_KEY_FILE)" >
<Output