-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-tests.sh
executable file
·38 lines (34 loc) · 1.53 KB
/
run-tests.sh
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
32
33
34
35
36
37
38
#!/bin/bash
# run-tests.sh will create the results, server, client containers and run tests
#
#
if [ -n "$RES_SRV" ]
then
echo "Setting up results server..."
docker context create perf_results_server --docker "host=ssh://$RES_SRV_USER@$RES_SRV:$RES_SRV_PORT"
docker context use perf_results_server
echo "Deploying results server..."
docker-compose -f docker-compose.yml --context perf_results_server --env-file .env up -d --build perf-results-sshd
docker-compose -f docker-compose.yml --context perf_results_server --env-file .env up -d --build perf-results-nginx
fi
if [ -n "$PERF_SRV" ]
then
echo "Configuring performance server..."
docker context create perf_remote_server --docker "host=ssh://$PERF_SRV_USER@$PERF_SRV:$PERF_SRV_PORT"
docker context use perf_remote_server
echo "Deploying performance server..."
docker-compose -f docker-compose.yml --context perf_remote_server --env-file .env up -d --build perf-server
fi
if [ -n "$PERF_CLIENT" ]
then
echo "Configuring performance client..."
docker context create perf_remote_client --docker "host=ssh://$PERF_CLIENT_USER@$PERF_CLIENT:$PERF_CLIENT_PORT"
docker context use perf_remote_client
echo "Deploying performance client..."
TEST_DEVICE=$1 docker-compose -f docker-compose.yml --context perf_remote_client --env-file .env up --build perf-client
fi
# Set context back to default, just in case
docker context rm perf_results_server -f
docker context rm perf_remote_server -f
docker context rm perf_remote_client -f
docker context use default