Skip to content

Commit

Permalink
chore: add commit information to build (#95)
Browse files Browse the repository at this point in the history
* chore: add commit information to build

* update manual deploy with build args

---------

Co-authored-by: acn-dgopa <acn-dgopa@dev-acn-tje-14>
  • Loading branch information
Alxandr and acn-dgopa authored Mar 20, 2024
1 parent 6f127f0 commit 23e1848
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-deploy-at.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
with:
push: true
tags: ghcr.io/altinn/altinn-auth-audit-log:${{ github.sha }}
build-args: |
SOURCE_REVISION_ID=${{ github.sha }}
deploy:
name: Deploy to ${{ matrix.environment }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/manual-build-deploy-to-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
with:
push: true
tags: ghcr.io/altinn/altinn-auth-audit-log:${{ github.sha }}
build-args: |
SOURCE_REVISION_ID=${{ github.sha }}
deploy:
name: Deploy to ${{ inputs.environment }}
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Building the auditlog api
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
ARG SOURCE_REVISION_ID=LOCALBUILD

COPY src .
WORKDIR Altinn.Auth.AuditLog/
RUN dotnet build Altinn.Auth.AuditLog.csproj -c Release -o /app_output
RUN dotnet publish Altinn.Auth.AuditLog.csproj -c Release -o /app_output
RUN echo "Building Altinn.Auth.AuditLog with SourceRevisionId=${SOURCE_REVISION_ID}"
RUN dotnet build Altinn.Auth.AuditLog.csproj -c Release -o /app_output -p SourceRevisionId=${SOURCE_REVISION_ID}
RUN dotnet publish Altinn.Auth.AuditLog.csproj -c Release -o /app_output -p SourceRevisionId=${SOURCE_REVISION_ID}

# Building the final image
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS final
Expand Down
4 changes: 4 additions & 0 deletions src/Altinn.Auth.AuditLog/Altinn.Auth.AuditLog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<PackageReference Include="Yuniql.PostgreSql" Version="1.3.15" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Altinn.Auth.AuditLog.Core\Altinn.Auth.AuditLog.Core.csproj" />
<ProjectReference Include="..\Altinn.Auth.AuditLog.Persistence\Altinn.Auth.AuditLog.Persistence.csproj" />
Expand Down

0 comments on commit 23e1848

Please sign in to comment.