diff --git a/outpost/azure-pipelines.yml b/outpost/azure-pipelines.yml index c3df49c67..a17cdf95f 100644 --- a/outpost/azure-pipelines.yml +++ b/outpost/azure-pipelines.yml @@ -117,6 +117,7 @@ stages: Dockerfile: 'outpost/proxy.Dockerfile' buildContext: 'outpost/' tags: "gh-$(branchName)" + arguments: '--build-arg GIT_BUILD_HASH=$(Build.SourceVersion)' - job: ldap_build_docker pool: vmImage: 'ubuntu-latest' @@ -142,3 +143,4 @@ stages: Dockerfile: 'outpost/ldap.Dockerfile' buildContext: 'outpost/' tags: "gh-$(branchName)" + arguments: '--build-arg GIT_BUILD_HASH=$(Build.SourceVersion)' diff --git a/outpost/ldap.Dockerfile b/outpost/ldap.Dockerfile index 08149fe05..a204c15be 100644 --- a/outpost/ldap.Dockerfile +++ b/outpost/ldap.Dockerfile @@ -1,4 +1,6 @@ FROM golang:1.16.4 AS builder +ARG GIT_BUILD_HASH +ENV GIT_BUILD_HASH=$GIT_BUILD_HASH WORKDIR /work diff --git a/outpost/pkg/ak/global.go b/outpost/pkg/ak/global.go index 108803ec3..c9417dd70 100644 --- a/outpost/pkg/ak/global.go +++ b/outpost/pkg/ak/global.go @@ -33,7 +33,8 @@ func doGlobalSetup(config map[string]interface{}) { default: log.SetLevel(log.DebugLevel) } - log.WithField("version", pkg.VERSION).Info("Starting authentik outpost") + buildHash := os.Getenv("GIT_BUILD_HASH") + log.WithField("buildHash", buildHash).WithField("version", pkg.VERSION).Info("Starting authentik outpost") var dsn string if config[ConfigErrorReportingEnabled].(bool) { diff --git a/outpost/proxy.Dockerfile b/outpost/proxy.Dockerfile index 8943b5a51..15861aed0 100644 --- a/outpost/proxy.Dockerfile +++ b/outpost/proxy.Dockerfile @@ -1,4 +1,6 @@ FROM golang:1.16.4 AS builder +ARG GIT_BUILD_HASH +ENV GIT_BUILD_HASH=$GIT_BUILD_HASH WORKDIR /work