aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-11-14 13:06:41 +0100
committerGitHub <noreply@github.com>2022-11-14 12:06:41 +0000
commit858a4af2244986356576b1cf97572275a8bc001f (patch)
tree4f344876b46970beef1107f29ec1ca0ee8fb48d9 /build
parent1e79b0557e177986262f365f6601fcdf56480a07 (diff)
Try to optimize CI (#2867)
Try to optimize CI by using caches
Diffstat (limited to 'build')
-rw-r--r--build/scripts/Complement.Dockerfile7
-rw-r--r--build/scripts/ComplementPostgres.Dockerfile7
2 files changed, 8 insertions, 6 deletions
diff --git a/build/scripts/Complement.Dockerfile b/build/scripts/Complement.Dockerfile
index 14b28498..79422e64 100644
--- a/build/scripts/Complement.Dockerfile
+++ b/build/scripts/Complement.Dockerfile
@@ -10,12 +10,13 @@ RUN mkdir /dendrite
# Utilise Docker caching when downloading dependencies, this stops us needlessly
# downloading dependencies every time.
+ARG CGO
RUN --mount=target=. \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
- go build -o /dendrite ./cmd/generate-config && \
- go build -o /dendrite ./cmd/generate-keys && \
- go build -o /dendrite ./cmd/dendrite-monolith-server
+ 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 ./cmd/dendrite-monolith-server
WORKDIR /dendrite
RUN ./generate-keys --private-key matrix_key.pem
diff --git a/build/scripts/ComplementPostgres.Dockerfile b/build/scripts/ComplementPostgres.Dockerfile
index 785090b0..3faf43cc 100644
--- a/build/scripts/ComplementPostgres.Dockerfile
+++ b/build/scripts/ComplementPostgres.Dockerfile
@@ -28,12 +28,13 @@ RUN mkdir /dendrite
# Utilise Docker caching when downloading dependencies, this stops us needlessly
# downloading dependencies every time.
+ARG CGO
RUN --mount=target=. \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
- go build -o /dendrite ./cmd/generate-config && \
- go build -o /dendrite ./cmd/generate-keys && \
- go build -o /dendrite ./cmd/dendrite-monolith-server
+ 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 ./cmd/dendrite-monolith-server
WORKDIR /dendrite
RUN ./generate-keys --private-key matrix_key.pem