forked from eandersson/amqpstorm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_ci_locally.sh
executable file
·33 lines (26 loc) · 1.13 KB
/
run_ci_locally.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
#!/bin/bash
set -o pipefail
set -e
# Build RabbitMQ container and start it.
docker rm amqpstormdev -f || true
docker build -t amqpstormdev ./docker/
docker run -d --hostname rmq.amqpstorm.io --name amqpstormdev -p 5671:5671 -p 5672:5672 -p 15671:15671 -p 15672:15672 amqpstormdev
docker cp amqpstormdev:/etc/rabbitmq/ssl/ ./amqpstorm/tests/resources/
# Wait for RabbitMQ to startup properly.
docker exec amqpstormdev wait-for-rabbitmq
# Print RabbitMQ version
echo "RabbitMQ Version: $(docker exec amqpstormdev rabbitmqctl --version)"
# Add user.
docker exec amqpstormdev rabbitmqctl add_user 'amqpstorm' '2a55f70a841f18b'
docker exec amqpstormdev rabbitmqctl -p / set_permissions 'amqpstorm' '.*' '.*' '.*'
docker exec amqpstormdev rabbitmqctl set_user_tags amqpstorm administrator
# Confirm all ports are reachable.
nc -zv rmq.amqpstorm.io 5671 || exit 1
nc -zv rmq.amqpstorm.io 5672 || exit 1
nc -zv rmq.amqpstorm.io 15671 || exit 1
nc -zv rmq.amqpstorm.io 15672 || exit 1
# Wait for a few seconds to make sure RabbitMQ has time so start properly.
sleep 3
# Run tests.
pytest --cov=./amqpstorm --durations=5
flake8 --ignore=F821 amqpstorm/