Skip to content
Snippets Groups Projects
Unverified Commit 538044ac authored by reivilibre's avatar reivilibre Committed by GitHub
Browse files

Collapse Docker build commands in Complement CI runs to make the logs easier to read. (#13058)

parent 941dc3db
No related branches found
No related tags found
No related merge requests found
...@@ -371,7 +371,7 @@ jobs: ...@@ -371,7 +371,7 @@ jobs:
- name: "Install Complement Dependencies" - name: "Install Complement Dependencies"
run: | run: |
sudo apt-get update && sudo apt-get install -y libolm3 libolm-dev sudo apt-get -qq update && sudo apt-get install -qqy libolm3 libolm-dev
go get -v github.com/haveyoudebuggedit/gotestfmt/v2/cmd/gotestfmt@latest go get -v github.com/haveyoudebuggedit/gotestfmt/v2/cmd/gotestfmt@latest
- name: Run actions/checkout@v2 for synapse - name: Run actions/checkout@v2 for synapse
......
Make Complement CI logs easier to read.
\ No newline at end of file
...@@ -40,7 +40,7 @@ FROM docker.io/python:${PYTHON_VERSION}-slim as requirements ...@@ -40,7 +40,7 @@ FROM docker.io/python:${PYTHON_VERSION}-slim as requirements
RUN \ RUN \
--mount=type=cache,target=/var/cache/apt,sharing=locked \ --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install -y git \ apt-get update -qq && apt-get install -yqq git \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# We install poetry in its own build stage to avoid its dependencies conflicting with # We install poetry in its own build stage to avoid its dependencies conflicting with
...@@ -73,7 +73,7 @@ FROM docker.io/python:${PYTHON_VERSION}-slim as builder ...@@ -73,7 +73,7 @@ FROM docker.io/python:${PYTHON_VERSION}-slim as builder
RUN \ RUN \
--mount=type=cache,target=/var/cache/apt,sharing=locked \ --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install -y \ apt-get update -qq && apt-get install -yqq \
build-essential \ build-essential \
libffi-dev \ libffi-dev \
libjpeg-dev \ libjpeg-dev \
...@@ -118,7 +118,7 @@ LABEL org.opencontainers.image.licenses='Apache-2.0' ...@@ -118,7 +118,7 @@ LABEL org.opencontainers.image.licenses='Apache-2.0'
RUN \ RUN \
--mount=type=cache,target=/var/cache/apt,sharing=locked \ --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install -y \ apt-get update -qq && apt-get install -yqq \
curl \ curl \
gosu \ gosu \
libjpeg62-turbo \ libjpeg62-turbo \
......
...@@ -6,8 +6,8 @@ FROM matrixdotorg/synapse:$SYNAPSE_VERSION ...@@ -6,8 +6,8 @@ FROM matrixdotorg/synapse:$SYNAPSE_VERSION
RUN \ RUN \
--mount=type=cache,target=/var/cache/apt,sharing=locked \ --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && \ apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ DEBIAN_FRONTEND=noninteractive apt-get install -yqq --no-install-recommends \
redis-server nginx-light redis-server nginx-light
# Install supervisord with pip instead of apt, to avoid installing a second # Install supervisord with pip instead of apt, to avoid installing a second
......
...@@ -9,7 +9,7 @@ FROM matrixdotorg/synapse-workers:$SYNAPSE_VERSION ...@@ -9,7 +9,7 @@ FROM matrixdotorg/synapse-workers:$SYNAPSE_VERSION
# Install postgresql # Install postgresql
RUN apt-get update && \ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y postgresql-13 DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -yqq postgresql-13
# Configure a user and create a database for Synapse # Configure a user and create a database for Synapse
RUN pg_ctlcluster 13 main start && su postgres -c "echo \ RUN pg_ctlcluster 13 main start && su postgres -c "echo \
......
...@@ -24,6 +24,15 @@ ...@@ -24,6 +24,15 @@
# Exit if a line returns a non-zero exit code # Exit if a line returns a non-zero exit code
set -e set -e
# Helper to emit annotations that collapse portions of the log in GitHub Actions
echo_if_github() {
if [[ -n "$GITHUB_WORKFLOW" ]]; then
echo $*
fi
}
# enable buildkit for the docker builds # enable buildkit for the docker builds
export DOCKER_BUILDKIT=1 export DOCKER_BUILDKIT=1
...@@ -41,14 +50,20 @@ if [[ -z "$COMPLEMENT_DIR" ]]; then ...@@ -41,14 +50,20 @@ if [[ -z "$COMPLEMENT_DIR" ]]; then
fi fi
# Build the base Synapse image from the local checkout # Build the base Synapse image from the local checkout
echo_if_github "::group::Build Docker image: matrixdotorg/synapse"
docker build -t matrixdotorg/synapse -f "docker/Dockerfile" . docker build -t matrixdotorg/synapse -f "docker/Dockerfile" .
echo_if_github "::endgroup::"
# Build the workers docker image (from the base Synapse image we just built). # Build the workers docker image (from the base Synapse image we just built).
echo_if_github "::group::Build Docker image: matrixdotorg/synapse-workers"
docker build -t matrixdotorg/synapse-workers -f "docker/Dockerfile-workers" . docker build -t matrixdotorg/synapse-workers -f "docker/Dockerfile-workers" .
echo_if_github "::endgroup::"
# Build the unified Complement image (from the worker Synapse image we just built). # Build the unified Complement image (from the worker Synapse image we just built).
echo_if_github "::group::Build Docker image: complement/Dockerfile"
docker build -t complement-synapse \ docker build -t complement-synapse \
-f "docker/complement/Dockerfile" "docker/complement" -f "docker/complement/Dockerfile" "docker/complement"
echo_if_github "::endgroup::"
export COMPLEMENT_BASE_IMAGE=complement-synapse export COMPLEMENT_BASE_IMAGE=complement-synapse
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment