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

Commit fa583c2

Browse files
authored
Allow overriding the complement ref. (#11766)
Updates complement.sh to read the ref from an environment variable (defaulting to master) when downloading a complement bundle for testing.
1 parent af13a3b commit fa583c2

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ __pycache__/
5252
book/
5353

5454
# complement
55-
/complement-master
55+
/complement-*
5656
/master.tar.gz

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

+8-6
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
34-
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'"
35+
COMPLEMENT_REF=${COMPLEMENT_REF:-master}
36+
echo "COMPLEMENT_DIR not set. Fetching Complement checkout from ${COMPLEMENT_REF}..."
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)