Merge commit 'd7dc087953ab7c67a1be08739465273b15973baf'

This commit is contained in:
Brian Meek 2022-09-16 13:28:19 -07:00
commit e36be5e8fa
3 changed files with 9 additions and 3 deletions

View file

@ -72,6 +72,8 @@ jobs:
file: ./build/docker/Dockerfile.monolith file: ./build/docker/Dockerfile.monolith
platforms: ${{ env.PLATFORMS }} platforms: ${{ env.PLATFORMS }}
push: true push: true
build-args: |
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
tags: | tags: |
${{ env.DOCKER_NAMESPACE }}/dendrite-monolith:latest ${{ env.DOCKER_NAMESPACE }}/dendrite-monolith:latest
${{ env.DOCKER_NAMESPACE }}/dendrite-monolith:${{ env.RELEASE_VERSION }} ${{ env.DOCKER_NAMESPACE }}/dendrite-monolith:${{ env.RELEASE_VERSION }}

View file

@ -2,12 +2,14 @@ FROM docker.io/golang:1.19-alpine AS base
RUN apk --update --no-cache add bash build-base RUN apk --update --no-cache add bash build-base
ARG RELEASE_VERSION="Unreleased"
WORKDIR /build WORKDIR /build
COPY . /build COPY . /build
RUN mkdir -p bin 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/create-account
RUN go build -trimpath -o bin/ ./cmd/generate-keys RUN go build -trimpath -o bin/ ./cmd/generate-keys

View file

@ -41,6 +41,8 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
var ReleaseVersion string
// Setup registers HTTP handlers with the given ServeMux. It also supplies the given http.Client // Setup registers HTTP handlers with the given ServeMux. It also supplies the given http.Client
// to clients which need to make outbound HTTP requests. // to clients which need to make outbound HTTP requests.
// //
@ -101,7 +103,7 @@ func Setup(
JSON: struct { JSON: struct {
Versions []string `json:"versions"` Versions []string `json:"versions"`
UnstableFeatures map[string]bool `json:"unstable_features"` UnstableFeatures map[string]bool `json:"unstable_features"`
BuildVersion string `json:"build_version"` ReleaseVersion string `json:"release_version"`
}{Versions: []string{ }{Versions: []string{
"r0.0.1", "r0.0.1",
"r0.1.0", "r0.1.0",
@ -113,7 +115,7 @@ func Setup(
"v1.0", "v1.0",
"v1.1", "v1.1",
"v1.2", "v1.2",
}, UnstableFeatures: unstableFeatures, BuildVersion: "TODO"}, }, UnstableFeatures: unstableFeatures, ReleaseVersion: ReleaseVersion},
} }
}), }),
).Methods(http.MethodGet, http.MethodOptions) ).Methods(http.MethodGet, http.MethodOptions)