Skip to content

Commit

Permalink
Fix local setup (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackYps authored Nov 8, 2021
1 parent ef32ae3 commit d32fe8c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
MYSQL_PASSWORD: banana

faf-rabbitmq:
image: rabbitmq:3-alpine
image: rabbitmq:3.8-management-alpine
ports:
- 5672:5672
options: >-
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and running `scripts/init-db.sh` should set this up.


Additionally, the service needs a running RabbitMQ server, which can be started
via docker by running `ci/init-rabbitmq.sh`.
via docker by running `scripts/local-rabbitmq.sh`.
This starts a RabbitMQ server on vhost `/faf-lobby`.

## Setting up for development
Expand Down
21 changes: 21 additions & 0 deletions scripts/local_rabbitmq.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

RABBITMQ_PID_FILE=/var/lib/rabbitmq/pid
RABBITMQ_DEFAULT_USER=admin
RABBITMQ_DEFAULT_PASS=banana
RABBITMQ_DEFAULT_VHOST=/
MAX_WAIT_SECONDS=30
RABBITMQ_LEAGUE_SERVICE_USER=faf-league-service
RABBITMQ_LEAGUE_SERVICE_PASS=banana
RABBITMQ_LEAGUE_SERVICE_VHOST=/faf-lobby

docker run -d -p 5672:5672 --restart unless-stopped --name faf-rabbitmq rabbitmq:3.8-management-alpine

# This doesn't seem to pick up the pid file
docker exec faf-rabbitmq rabbitmqctl wait --timeout ${MAX_WAIT_SECONDS} "${RABBITMQ_PID_FILE}"
# Create RabbitMQ users
docker exec faf-rabbitmq rabbitmqctl add_vhost "${RABBITMQ_LEAGUE_SERVICE_VHOST}"
docker exec faf-rabbitmq rabbitmqctl add_user "${RABBITMQ_LEAGUE_SERVICE_USER}" "${RABBITMQ_LEAGUE_SERVICE_PASS}"
docker exec faf-rabbitmq rabbitmqctl set_permissions -p "${RABBITMQ_LEAGUE_SERVICE_VHOST}" "${RABBITMQ_LEAGUE_SERVICE_USER}" ".*" ".*" ".*"


0 comments on commit d32fe8c

Please sign in to comment.