outposts: include git commit hash in build from git branch
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
e9aa37ba67
commit
37b57ac28f
|
@ -117,6 +117,7 @@ stages:
|
||||||
Dockerfile: 'outpost/proxy.Dockerfile'
|
Dockerfile: 'outpost/proxy.Dockerfile'
|
||||||
buildContext: 'outpost/'
|
buildContext: 'outpost/'
|
||||||
tags: "gh-$(branchName)"
|
tags: "gh-$(branchName)"
|
||||||
|
arguments: '--build-arg GIT_BUILD_HASH=$(Build.SourceVersion)'
|
||||||
- job: ldap_build_docker
|
- job: ldap_build_docker
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'ubuntu-latest'
|
vmImage: 'ubuntu-latest'
|
||||||
|
@ -142,3 +143,4 @@ stages:
|
||||||
Dockerfile: 'outpost/ldap.Dockerfile'
|
Dockerfile: 'outpost/ldap.Dockerfile'
|
||||||
buildContext: 'outpost/'
|
buildContext: 'outpost/'
|
||||||
tags: "gh-$(branchName)"
|
tags: "gh-$(branchName)"
|
||||||
|
arguments: '--build-arg GIT_BUILD_HASH=$(Build.SourceVersion)'
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
FROM golang:1.16.4 AS builder
|
FROM golang:1.16.4 AS builder
|
||||||
|
ARG GIT_BUILD_HASH
|
||||||
|
ENV GIT_BUILD_HASH=$GIT_BUILD_HASH
|
||||||
|
|
||||||
WORKDIR /work
|
WORKDIR /work
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,8 @@ func doGlobalSetup(config map[string]interface{}) {
|
||||||
default:
|
default:
|
||||||
log.SetLevel(log.DebugLevel)
|
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
|
var dsn string
|
||||||
if config[ConfigErrorReportingEnabled].(bool) {
|
if config[ConfigErrorReportingEnabled].(bool) {
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
FROM golang:1.16.4 AS builder
|
FROM golang:1.16.4 AS builder
|
||||||
|
ARG GIT_BUILD_HASH
|
||||||
|
ENV GIT_BUILD_HASH=$GIT_BUILD_HASH
|
||||||
|
|
||||||
WORKDIR /work
|
WORKDIR /work
|
||||||
|
|
||||||
|
|
Reference in New Issue