From 9d4a96b078b789b250e634276937f3b58e21e994 Mon Sep 17 00:00:00 2001
From: tangowithfoxtrot <5676771+tangowithfoxtrot@users.noreply.github.com>
Date: Mon, 19 May 2025 11:20:42 -0700
Subject: [PATCH] build: restore previous method for getting the GIT_HASH
---
Directory.Build.props | 17 +++++++++++++++++
bitwarden_license/src/Sso/Dockerfile | 1 -
src/Admin/Dockerfile | 2 --
src/Api/Dockerfile | 2 --
src/Billing/Dockerfile | 2 --
src/Events/Dockerfile | 2 --
src/EventsProcessor/Dockerfile | 2 --
src/Icons/Dockerfile | 2 --
src/Identity/Dockerfile | 2 --
src/Notifications/Dockerfile | 2 --
util/Attachments/Dockerfile | 1 -
util/MsSqlMigratorUtility/Dockerfile | 2 --
util/Setup/Dockerfile | 2 --
13 files changed, 17 insertions(+), 22 deletions(-)
diff --git a/Directory.Build.props b/Directory.Build.props
index 72fe2fc7af..152b451825 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -52,4 +52,21 @@
4.18.1
+
+
+
+
+
+
+
+
+
+ <_Parameter1>GitHash
+ <_Parameter2>$(SourceRevisionId)
+
+
+
diff --git a/bitwarden_license/src/Sso/Dockerfile b/bitwarden_license/src/Sso/Dockerfile
index bb77d5526d..ab9384d7d2 100644
--- a/bitwarden_license/src/Sso/Dockerfile
+++ b/bitwarden_license/src/Sso/Dockerfile
@@ -31,7 +31,6 @@ RUN . /tmp/rid.txt && dotnet publish \
--no-restore \
--self-contained \
/p:PublishSingleFile=true \
- /p:SourceRevisionId="$GIT_COMMIT" \
-r $RID \
-o out
diff --git a/src/Admin/Dockerfile b/src/Admin/Dockerfile
index b1a3d772c0..cf839e56a9 100644
--- a/src/Admin/Dockerfile
+++ b/src/Admin/Dockerfile
@@ -2,7 +2,6 @@
# Build stage #
###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
-ARG GIT_COMMIT
# Docker buildx supplies the value for this arg
ARG TARGETPLATFORM
@@ -39,7 +38,6 @@ RUN npm run build
RUN . /tmp/rid.txt && dotnet publish \
--self-contained \
/p:PublishSingleFile=true \
- /p:SourceRevisionId="$GIT_COMMIT" \
-r $RID \
-o out
diff --git a/src/Api/Dockerfile b/src/Api/Dockerfile
index f5327a37f4..a37c0ae8d4 100644
--- a/src/Api/Dockerfile
+++ b/src/Api/Dockerfile
@@ -2,7 +2,6 @@
# Build stage #
###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
-ARG GIT_COMMIT
# Docker buildx supplies the value for this arg
ARG TARGETPLATFORM
@@ -32,7 +31,6 @@ RUN . /tmp/rid.txt && dotnet publish \
--no-restore \
--self-contained \
/p:PublishSingleFile=true \
- /p:SourceRevisionId="$GIT_COMMIT" \
-r $RID \
-o out
diff --git a/src/Billing/Dockerfile b/src/Billing/Dockerfile
index 3a6b8aac48..50059cfcbd 100644
--- a/src/Billing/Dockerfile
+++ b/src/Billing/Dockerfile
@@ -2,7 +2,6 @@
# Build stage #
###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
-ARG GIT_COMMIT
# Docker buildx supplies the value for this arg
ARG TARGETPLATFORM
@@ -32,7 +31,6 @@ RUN . /tmp/rid.txt && dotnet publish \
--no-restore \
--self-contained \
/p:PublishSingleFile=true \
- /p:SourceRevisionId="$GIT_COMMIT" \
-r $RID \
-o out
diff --git a/src/Events/Dockerfile b/src/Events/Dockerfile
index 708e96019f..490a862ebf 100644
--- a/src/Events/Dockerfile
+++ b/src/Events/Dockerfile
@@ -2,7 +2,6 @@
# Build stage #
###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
-ARG GIT_COMMIT
# Docker buildx supplies the value for this arg
ARG TARGETPLATFORM
@@ -32,7 +31,6 @@ RUN . /tmp/rid.txt && dotnet publish \
--no-restore \
--self-contained \
/p:PublishSingleFile=true \
- /p:SourceRevisionId="$GIT_COMMIT" \
-r $RID \
-o out
diff --git a/src/EventsProcessor/Dockerfile b/src/EventsProcessor/Dockerfile
index 66cbd0e621..89ba4c3137 100644
--- a/src/EventsProcessor/Dockerfile
+++ b/src/EventsProcessor/Dockerfile
@@ -2,7 +2,6 @@
# Build stage #
###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
-ARG GIT_COMMIT
# Docker buildx supplies the value for this arg
ARG TARGETPLATFORM
@@ -32,7 +31,6 @@ RUN . /tmp/rid.txt && dotnet publish \
--no-restore \
--self-contained \
/p:PublishSingleFile=true \
- /p:SourceRevisionId="$GIT_COMMIT" \
-r $RID \
-o out
diff --git a/src/Icons/Dockerfile b/src/Icons/Dockerfile
index 786d30af56..5f7c4e8e8e 100644
--- a/src/Icons/Dockerfile
+++ b/src/Icons/Dockerfile
@@ -2,7 +2,6 @@
# Build stage #
###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
-ARG GIT_COMMIT
# Docker buildx supplies the value for this arg
ARG TARGETPLATFORM
@@ -31,7 +30,6 @@ RUN . /tmp/rid.txt && dotnet publish \
--no-restore \
--self-contained \
/p:PublishSingleFile=true \
- /p:SourceRevisionId="$GIT_COMMIT" \
-r $RID \
-o out
diff --git a/src/Identity/Dockerfile b/src/Identity/Dockerfile
index 5c2a8e4064..dd81a05f33 100644
--- a/src/Identity/Dockerfile
+++ b/src/Identity/Dockerfile
@@ -2,7 +2,6 @@
# Build stage #
###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
-ARG GIT_COMMIT
# Docker buildx supplies the value for this arg
ARG TARGETPLATFORM
@@ -32,7 +31,6 @@ RUN . /tmp/rid.txt && dotnet publish \
--no-restore \
--self-contained \
/p:PublishSingleFile=true \
- /p:SourceRevisionId="$GIT_COMMIT" \
-r $RID \
-o out
diff --git a/src/Notifications/Dockerfile b/src/Notifications/Dockerfile
index bdf9373f48..2d7aa34069 100644
--- a/src/Notifications/Dockerfile
+++ b/src/Notifications/Dockerfile
@@ -2,7 +2,6 @@
# Build stage #
###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
-ARG GIT_COMMIT
# Docker buildx supplies the value for this arg
ARG TARGETPLATFORM
@@ -32,7 +31,6 @@ RUN . /tmp/rid.txt && dotnet publish \
--no-restore \
--self-contained \
/p:PublishSingleFile=true \
- /p:SourceRevisionId="$GIT_COMMIT" \
-r $RID \
-o out
diff --git a/util/Attachments/Dockerfile b/util/Attachments/Dockerfile
index 47b8660d9e..efaf5bd50c 100644
--- a/util/Attachments/Dockerfile
+++ b/util/Attachments/Dockerfile
@@ -30,7 +30,6 @@ WORKDIR /source/util/Server
RUN . /tmp/rid.txt && dotnet publish \
--self-contained \
/p:PublishSingleFile=true \
- /p:SourceRevisionId="$GIT_COMMIT" \
-r $RID \
-o out
diff --git a/util/MsSqlMigratorUtility/Dockerfile b/util/MsSqlMigratorUtility/Dockerfile
index eab9bf8b65..9d0c878199 100644
--- a/util/MsSqlMigratorUtility/Dockerfile
+++ b/util/MsSqlMigratorUtility/Dockerfile
@@ -2,7 +2,6 @@
# Build stage #
###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
-ARG GIT_COMMIT
# Docker buildx supplies the value for this arg
ARG TARGETPLATFORM
@@ -46,7 +45,6 @@ WORKDIR /source/util/MsSqlMigratorUtility
RUN . /tmp/rid.txt && dotnet publish \
--self-contained \
/p:PublishSingleFile=true \
- /p:SourceRevisionId="$GIT_COMMIT" \
-r $RID \
-o out
diff --git a/util/Setup/Dockerfile b/util/Setup/Dockerfile
index eafae1b1bd..f36a329019 100644
--- a/util/Setup/Dockerfile
+++ b/util/Setup/Dockerfile
@@ -2,7 +2,6 @@
# Build stage #
###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
-ARG GIT_COMMIT
# Docker buildx supplies the value for this arg
ARG TARGETPLATFORM
@@ -32,7 +31,6 @@ RUN . /tmp/rid.txt && dotnet publish \
-c release \
--no-restore \
--self-contained \
- /p:SourceRevisionId="$GIT_COMMIT" \
-r $RID \
-o out