Add commit hash to routing version API, TODO placeholder

Signed-off-by: Brian Meek <brian@hntlabs.com>
This commit is contained in:
Brian Meek 2022-09-15 15:12:56 -07:00 committed by Tak Wai Wong
parent 8351e35287
commit 4fe6a9e9da
No known key found for this signature in database
GPG key ID: 222E4AF2AA1F467D
2 changed files with 3 additions and 6 deletions

View file

@ -7,7 +7,7 @@ WORKDIR /build
COPY . /build
RUN mkdir -p bin
RUN go build -ldflags="-X 'routing.CommitHash=`git rev-list -1 HEAD`'" -trimpath -o bin/ ./cmd/dendrite-monolith-server
RUN go build -trimpath -o bin/ ./cmd/dendrite-monolith-server
RUN go build -trimpath -o bin/ ./cmd/create-account
RUN go build -trimpath -o bin/ ./cmd/generate-keys

View file

@ -42,9 +42,6 @@ import (
userapi "github.com/matrix-org/dendrite/userapi/api"
)
// Added in build script Cokerfile.monolith
var CommitHash string
// Setup registers HTTP handlers with the given ServeMux. It also supplies the given http.Client
// to clients which need to make outbound HTTP requests.
//
@ -106,7 +103,7 @@ func Setup(
JSON: struct {
Versions []string `json:"versions"`
UnstableFeatures map[string]bool `json:"unstable_features"`
CommitHash string `json:"commit_hash"`
BuildVersion string `json:"build_version"`
}{Versions: []string{
"r0.0.1",
"r0.1.0",
@ -118,7 +115,7 @@ func Setup(
"v1.0",
"v1.1",
"v1.2",
}, UnstableFeatures: unstableFeatures, CommitHash: CommitHash},
}, UnstableFeatures: unstableFeatures, BuildVersion: "TODO"},
}
}),
).Methods(http.MethodGet, http.MethodOptions)