mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-11 16:13:10 -06:00
Add commit ReleaseVersion to routing to return to clients in version request
Signed-off-by: Brian Meek <brian@hntlabs.com>
This commit is contained in:
parent
b95657fe94
commit
d7dc087953
2
.github/workflows/docker.yml
vendored
2
.github/workflows/docker.yml
vendored
|
|
@ -72,6 +72,8 @@ jobs:
|
|||
file: ./build/docker/Dockerfile.monolith
|
||||
platforms: ${{ env.PLATFORMS }}
|
||||
push: true
|
||||
build-args: |
|
||||
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
|
||||
tags: |
|
||||
${{ env.DOCKER_NAMESPACE }}/dendrite-monolith:latest
|
||||
${{ env.DOCKER_NAMESPACE }}/dendrite-monolith:${{ env.RELEASE_VERSION }}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,14 @@ FROM docker.io/golang:1.19-alpine AS base
|
|||
|
||||
RUN apk --update --no-cache add bash build-base
|
||||
|
||||
ARG RELEASE_VERSION="Unreleased"
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
COPY . /build
|
||||
|
||||
RUN mkdir -p bin
|
||||
RUN go build -trimpath -o bin/ ./cmd/dendrite-monolith-server
|
||||
RUN go build -trimpath -o bin/ -ldflags="-X routing.ReleaseVersion=$RELEASE_VERSION" ./cmd/dendrite-monolith-server
|
||||
RUN go build -trimpath -o bin/ ./cmd/create-account
|
||||
RUN go build -trimpath -o bin/ ./cmd/generate-keys
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ import (
|
|||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var ReleaseVersion 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.
|
||||
//
|
||||
|
|
@ -101,7 +103,7 @@ func Setup(
|
|||
JSON: struct {
|
||||
Versions []string `json:"versions"`
|
||||
UnstableFeatures map[string]bool `json:"unstable_features"`
|
||||
BuildVersion string `json:"build_version"`
|
||||
ReleaseVersion string `json:"release_version"`
|
||||
}{Versions: []string{
|
||||
"r0.0.1",
|
||||
"r0.1.0",
|
||||
|
|
@ -113,7 +115,7 @@ func Setup(
|
|||
"v1.0",
|
||||
"v1.1",
|
||||
"v1.2",
|
||||
}, UnstableFeatures: unstableFeatures, BuildVersion: "TODO"},
|
||||
}, UnstableFeatures: unstableFeatures, ReleaseVersion: ReleaseVersion},
|
||||
}
|
||||
}),
|
||||
).Methods(http.MethodGet, http.MethodOptions)
|
||||
|
|
|
|||
Loading…
Reference in a new issue