diff --git a/Dockerfile b/Dockerfile index fe6ad53f..1e0e5c69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 index ab11879b..7abc6a53 100644 --- a/Dockerfile.arm32v7 +++ b/Dockerfile.arm32v7 @@ -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 diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 index b35a5ffb..9682b94d 100644 --- a/Dockerfile.arm64v8 +++ b/Dockerfile.arm64v8 @@ -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 diff --git a/cmd/authelia-scripts/cmd_docker.go b/cmd/authelia-scripts/cmd_docker.go index 1998fc3b..d01b14ae 100644 --- a/cmd/authelia-scripts/cmd_docker.go +++ b/cmd/authelia-scripts/cmd_docker.go @@ -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(?P(?P\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") diff --git a/cmd/authelia/main.go b/cmd/authelia/main.go index f69e0273..3a24a0fc 100644 --- a/cmd/authelia/main.go +++ b/cmd/authelia/main.go @@ -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) }, }