aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 450e7888433ab328986676728923565ca0a67451 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
SYNAPSE_IMAGE="matrixdotorg/synapse:v1.24.0"

test: ## Run the tests
	@cd build/ && GTEST_COLOR=1 ctest --verbose

synapse: ## Start a synapse instance on docker
	@mkdir -p data
	@chmod 0777 data
	@docker run -v `pwd`/data:/data --rm \
		-e SYNAPSE_SERVER_NAME=localhost -e SYNAPSE_REPORT_STATS=no ${SYNAPSE_IMAGE} generate
	@./.ci/adjust-config.sh
	@docker run -d \
		--name synapse \
		-p 443:8008 \
		-p 8448:8008 \
		-p 8008:8008 \
		-v `pwd`/data:/data ${SYNAPSE_IMAGE}
	@echo Waiting for synapse to start...
	@until curl -s -f -k https://localhost:443/_matrix/client/versions; do echo "Checking ..."; sleep 2; done
	@echo Register alice
	@docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u alice -p secret -c /data/homeserver.yaml https://localhost:8008'
	@echo Register bob
	@docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u bob -p secret -c /data/homeserver.yaml https://localhost:8008'
	@echo Register carl
	@docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u carl -p secret -c /data/homeserver.yaml https://localhost:8008'

stop-synapse: ## Stop any running instance of synapse
	@rm -rf ./data/*
	@docker rm -f synapse 2>&1>/dev/null

restart: stop-synapse synapse