Add git tag back to binary artifact.

This commit is contained in:
Amir Zarrinkafsh 2020-01-13 11:30:05 +11:00 committed by GitHub
parent a823b6368a
commit 5914f96de4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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")

View File

@ -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)
},
}