Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit e8a73af

Browse files
committed
Allow overriding the complement ref
Allows you to define COMPLEMENT_REF to use a different branch or commit than master, when running complement and not using a local COMPLEMENT_DIR. Signed-off-by: Nicolas Werner <[email protected]>
1 parent 15ffc41 commit e8a73af

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

changelog.d/11766.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Allow overriding complement commit using `COMPLEMENT_REF`.

scripts-dev/complement.sh

+7-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
# By default the script will fetch the latest Complement master branch and
99
# run tests with that. This can be overridden to use a custom Complement
1010
# checkout by setting the COMPLEMENT_DIR environment variable to the
11-
# filepath of a local Complement checkout.
11+
# filepath of a local Complement checkout or by setting the COMPLEMENT_REF
12+
# environment variable to pull a different branch or commit.
1213
#
1314
# By default Synapse is run in monolith mode. This can be overridden by
1415
# setting the WORKERS environment variable.
@@ -31,11 +32,12 @@ cd "$(dirname $0)/.."
3132

3233
# Check for a user-specified Complement checkout
3334
if [[ -z "$COMPLEMENT_DIR" ]]; then
35+
COMPLEMENT_REF=${COMPLEMENT_REF:-master}
3436
echo "COMPLEMENT_DIR not set. Fetching the latest Complement checkout..."
35-
wget -Nq https://github.com/matrix-org/complement/archive/master.tar.gz
36-
tar -xzf master.tar.gz
37-
COMPLEMENT_DIR=complement-master
38-
echo "Checkout available at 'complement-master'"
37+
wget -Nq https://github.com/matrix-org/complement/archive/${COMPLEMENT_REF}.tar.gz
38+
tar -xzf ${COMPLEMENT_REF}.tar.gz
39+
COMPLEMENT_DIR=complement-${COMPLEMENT_REF}
40+
echo "Checkout available at 'complement-${COMPLEMENT_REF}'"
3941
fi
4042

4143
# Build the base Synapse image from the local checkout

0 commit comments

Comments
 (0)