aboutsummaryrefslogtreecommitdiff
path: root/build/scripts
diff options
context:
space:
mode:
authorTill Faelligen <2353100+S7evinK@users.noreply.github.com>2023-03-22 14:12:06 +0100
committerTill Faelligen <2353100+S7evinK@users.noreply.github.com>2023-03-22 14:50:21 +0100
commit6948d1652742ae83cf7729f1cfaa0d1ea796b703 (patch)
tree018638a36cff184d792a429e503488da3a983b2a /build/scripts
parent5e85a00cb36c3d343cd5b6f6a18435989724a135 (diff)
Update Go, use go tool covdata for coverage files?
Diffstat (limited to 'build/scripts')
-rw-r--r--build/scripts/Complement.Dockerfile4
-rw-r--r--build/scripts/ComplementPostgres.Dockerfile10
-rwxr-xr-xbuild/scripts/complement-cmd.sh5
3 files changed, 10 insertions, 9 deletions
diff --git a/build/scripts/Complement.Dockerfile b/build/scripts/Complement.Dockerfile
index 70bbe8f9..453d8976 100644
--- a/build/scripts/Complement.Dockerfile
+++ b/build/scripts/Complement.Dockerfile
@@ -1,6 +1,6 @@
#syntax=docker/dockerfile:1.2
-FROM golang:1.18-stretch as build
+FROM golang:1.20-bullseye as build
RUN apt-get update && apt-get install -y sqlite3
WORKDIR /build
@@ -17,7 +17,7 @@ RUN --mount=target=. \
CGO_ENABLED=${CGO} go build -o /dendrite ./cmd/generate-config && \
CGO_ENABLED=${CGO} go build -o /dendrite ./cmd/generate-keys && \
CGO_ENABLED=${CGO} go build -o /dendrite/dendrite ./cmd/dendrite && \
- CGO_ENABLED=${CGO} go test -c -cover -covermode=atomic -o /dendrite/dendrite-cover -coverpkg "github.com/matrix-org/..." ./cmd/dendrite && \
+ CGO_ENABLED=${CGO} go build -cover -covermode=atomic -o /dendrite/dendrite-cover -coverpkg "github.com/matrix-org/..." ./cmd/dendrite && \
cp build/scripts/complement-cmd.sh /complement-cmd.sh
WORKDIR /dendrite
diff --git a/build/scripts/ComplementPostgres.Dockerfile b/build/scripts/ComplementPostgres.Dockerfile
index d4b6d3f7..77071b45 100644
--- a/build/scripts/ComplementPostgres.Dockerfile
+++ b/build/scripts/ComplementPostgres.Dockerfile
@@ -1,19 +1,19 @@
#syntax=docker/dockerfile:1.2
-FROM golang:1.18-stretch as build
+FROM golang:1.20-bullseye as build
RUN apt-get update && apt-get install -y postgresql
WORKDIR /build
# No password when connecting over localhost
-RUN sed -i "s%127.0.0.1/32 md5%127.0.0.1/32 trust%g" /etc/postgresql/9.6/main/pg_hba.conf && \
+RUN sed -i "s%127.0.0.1/32 md5%127.0.0.1/32 trust%g" /etc/postgresql/13/main/pg_hba.conf && \
# Bump up max conns for moar concurrency
- sed -i 's/max_connections = 100/max_connections = 2000/g' /etc/postgresql/9.6/main/postgresql.conf
+ sed -i 's/max_connections = 100/max_connections = 2000/g' /etc/postgresql/13/main/postgresql.conf
# This entry script starts postgres, waits for it to be up then starts dendrite
RUN echo '\
#!/bin/bash -eu \n\
pg_lsclusters \n\
- pg_ctlcluster 9.6 main start \n\
+ pg_ctlcluster 13 main start \n\
\n\
until pg_isready \n\
do \n\
@@ -35,7 +35,7 @@ RUN --mount=target=. \
CGO_ENABLED=${CGO} go build -o /dendrite ./cmd/generate-config && \
CGO_ENABLED=${CGO} go build -o /dendrite ./cmd/generate-keys && \
CGO_ENABLED=${CGO} go build -o /dendrite/dendrite ./cmd/dendrite && \
- CGO_ENABLED=${CGO} go test -c -cover -covermode=atomic -o /dendrite/dendrite-cover -coverpkg "github.com/matrix-org/..." ./cmd/dendrite && \
+ CGO_ENABLED=${CGO} go build -cover -covermode=atomic -o /dendrite/dendrite-cover -coverpkg "github.com/matrix-org/..." ./cmd/dendrite && \
cp build/scripts/complement-cmd.sh /complement-cmd.sh
WORKDIR /dendrite
diff --git a/build/scripts/complement-cmd.sh b/build/scripts/complement-cmd.sh
index 52b063d0..3f6ed070 100755
--- a/build/scripts/complement-cmd.sh
+++ b/build/scripts/complement-cmd.sh
@@ -2,14 +2,15 @@
# This script is intended to be used inside a docker container for Complement
+export GOCOVERDIR=/tmp/covdatafiles
+mkdir -p "${GOCOVERDIR}"
if [[ "${COVER}" -eq 1 ]]; then
echo "Running with coverage"
exec /dendrite/dendrite-cover \
--really-enable-open-registration \
--tls-cert server.crt \
--tls-key server.key \
- --config dendrite.yaml \
- --test.coverprofile=complementcover.log
+ --config dendrite.yaml
else
echo "Not running with coverage"
exec /dendrite/dendrite \