1010# checkout by setting the COMPLEMENT_DIR environment variable to the
1111# filepath of a local Complement checkout.
1212#
13+ # By default Synapse is run in monolith mode. This can be overridden by
14+ # setting the WORKERS environment variable.
15+ #
1316# A regular expression of test method names can be supplied as the first
1417# argument to the script. Complement will then only run those tests. If
1518# no regex is supplied, all tests are run. For example;
@@ -32,10 +35,26 @@ if [[ -z "$COMPLEMENT_DIR" ]]; then
3235 echo " Checkout available at 'complement-master'"
3336fi
3437
38+ # If we're using workers, modify the docker files slightly.
39+ if [[ -n " $WORKERS " ]]; then
40+ BASE_IMAGE=matrixdotorg/synapse-workers
41+ BASE_DOCKERFILE=docker/Dockerfile-workers
42+ export COMPLEMENT_BASE_IMAGE=complement-synapse-workers
43+ COMPLEMENT_DOCKERFILE=SynapseWorkers.Dockerfile
44+ # And provide some more configuration to complement.
45+ export COMPLEMENT_CA=true
46+ export COMPLEMENT_VERSION_CHECK_ITERATIONS=500
47+ else
48+ BASE_IMAGE=matrixdotorg/synapse
49+ BASE_DOCKERFILE=docker/Dockerfile
50+ export COMPLEMENT_BASE_IMAGE=complement-synapse
51+ COMPLEMENT_DOCKERFILE=Synapse.Dockerfile
52+ fi
53+
3554# Build the base Synapse image from the local checkout
36- docker build -t matrixdotorg/synapse -f docker/Dockerfile .
55+ docker build -t $BASE_IMAGE -f " $BASE_DOCKERFILE " .
3756# Build the Synapse monolith image from Complement, based on the above image we just built
38- docker build -t complement-synapse -f " $COMPLEMENT_DIR /dockerfiles/Synapse.Dockerfile " " $COMPLEMENT_DIR /dockerfiles"
57+ docker build -t $COMPLEMENT_BASE_IMAGE -f " $COMPLEMENT_DIR /dockerfiles/$COMPLEMENT_DOCKERFILE " " $COMPLEMENT_DIR /dockerfiles"
3958
4059cd " $COMPLEMENT_DIR "
4160
@@ -46,4 +65,4 @@ if [[ -n "$1" ]]; then
4665fi
4766
4867# Run the tests!
49- COMPLEMENT_BASE_IMAGE=complement-synapse go test -v -tags synapse_blacklist,msc2946,msc3083 -count=1 $EXTRA_COMPLEMENT_ARGS ./tests
68+ go test -v -tags synapse_blacklist,msc2946,msc3083 -count=1 $EXTRA_COMPLEMENT_ARGS ./tests
0 commit comments