Add git tag back to binary artifact.
parent
a823b6368a
commit
5914f96de4
|
@ -20,7 +20,7 @@ COPY internal internal
|
|||
|
||||
# Set the build version and time
|
||||
RUN echo "Write tag ${BUILD_TAG} and commit ${BUILD_COMMIT} in binary." && \
|
||||
BUILD_TIME=`date +"%Y-%m-%d %T"` && \
|
||||
sed -i "s/__BUILD_TAG__/${BUILD_TAG}/" cmd/authelia/constants.go && \
|
||||
sed -i "s/__BUILD_COMMIT__/${BUILD_COMMIT}/" cmd/authelia/constants.go
|
||||
|
||||
# CGO_ENABLED=1 is mandatory for building go-sqlite3
|
||||
|
|
|
@ -23,7 +23,7 @@ COPY internal internal
|
|||
|
||||
# Set the build version and time
|
||||
RUN echo "Write tag ${BUILD_TAG} and commit ${BUILD_COMMIT} in binary." && \
|
||||
BUILD_TIME=`date +"%Y-%m-%d %T"` && \
|
||||
sed -i "s/__BUILD_TAG__/${BUILD_TAG}/" cmd/authelia/constants.go && \
|
||||
sed -i "s/__BUILD_COMMIT__/${BUILD_COMMIT}/" cmd/authelia/constants.go
|
||||
|
||||
# CGO_ENABLED=1 is mandatory for building go-sqlite3
|
||||
|
|
|
@ -23,7 +23,7 @@ COPY internal internal
|
|||
|
||||
# Set the build version and time
|
||||
RUN echo "Write tag ${BUILD_TAG} and commit ${BUILD_COMMIT} in binary." && \
|
||||
BUILD_TIME=`date +"%Y-%m-%d %T"` && \
|
||||
sed -i "s/__BUILD_TAG__/${BUILD_TAG}/" cmd/authelia/constants.go && \
|
||||
sed -i "s/__BUILD_COMMIT__/${BUILD_COMMIT}/" cmd/authelia/constants.go
|
||||
|
||||
# CGO_ENABLED=1 is mandatory for building go-sqlite3
|
||||
|
|
|
@ -18,12 +18,14 @@ var supportedArch = []string{"amd64", "arm32v7", "arm64v8", "CI"}
|
|||
var defaultArch = "amd64"
|
||||
var buildkite = os.Getenv("BUILDKITE")
|
||||
var buildkiteQEMU = os.Getenv("BUILDKITE_AGENT_META_DATA_QEMU")
|
||||
|
||||
//TODO(nightah): Uncomment when turning off Travis
|
||||
//var ciBranch = os.Getenv("BUILDKITE_BRANCH")
|
||||
//var ciPullRequest = os.Getenv("BUILDKITE_PULL_REQUEST")
|
||||
//var ciTag = os.Getenv("BUILDKITE_TAG")
|
||||
var dockerTags = regexp.MustCompile(`v(?P<Patch>(?P<Minor>(?P<Major>\d+)\.\d+)\.\d+.*)`)
|
||||
var ignoredSuffixes = regexp.MustCompile("alpha|beta")
|
||||
|
||||
//var tags = dockerTags.FindStringSubmatch(ciTag)
|
||||
//TODO(nightah): Uncomment when turning off Travis
|
||||
|
||||
|
@ -92,8 +94,8 @@ func dockerBuildOfficialImage(arch string) error {
|
|||
|
||||
gitTag := ciTag
|
||||
if gitTag == "" {
|
||||
// If commit is not tagged, mark the build has having unknown tag.
|
||||
gitTag = "unknown"
|
||||
// If commit is not tagged, mark the build has having master tag.
|
||||
gitTag = "master"
|
||||
}
|
||||
|
||||
cmd := utils.Shell("git rev-parse HEAD")
|
||||
|
|
|
@ -114,7 +114,7 @@ func main() {
|
|||
versionCmd := &cobra.Command{
|
||||
Use: "version",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Printf("build git commit: %s\n", BuildCommit)
|
||||
fmt.Printf("Authelia version %s, build %s", BuildTag, BuildCommit)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue