Skip to content

Commit e8adcc9

Browse files
authored
Fix AMQP related errors while building the environment (CodelyTV#253)
1 parent 7a000fd commit e8adcc9

6 files changed

Lines changed: 22 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,28 @@ jobs:
1616

1717
- run: docker-compose pull
1818

19-
- uses: satackey/action-docker-layer-caching@v0.0.11
20-
continue-on-error: true
21-
with:
22-
key: php_ddd_example-cache-${{ secrets.CACHE_VERSION }}-{hash}
23-
restore-keys: |
24-
php_ddd_example-cache-${{ secrets.CACHE_VERSION }}-
25-
- name: Install dependencies
19+
- name: 🎻 Install dependencies
2620
run: make composer-install
2721

28-
- name: Start all the environment
22+
- name: 🐳 Start all the environment
2923
run: make start
3024

31-
- name: Wait for the environment to get up
25+
- name: 🏁 Static analysis
26+
run: make static-analysis
27+
28+
- name: 🦭 Wait for the database to get up
3229
run: |
3330
while ! make ping-mysql &>/dev/null; do
3431
echo "Waiting for database connection..."
3532
sleep 2
3633
done
3734
38-
- name: Run the tests
39-
run: make test
35+
- name: 🐰 Wait for the message broker to get up
36+
run: |
37+
while ! make ping-rabbitmq &>/dev/null; do
38+
echo "Waiting for RabbitMQ connection..."
39+
sleep 2
40+
done
4041
41-
- name: Static analysis
42-
run: make static-analysis
42+
- name: ✅ Run the tests
43+
run: make test

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN apk --update upgrade \
1414
zip \
1515
pdo_mysql
1616

17-
RUN pickle install apcu-5.1.20
17+
RUN pickle install apcu@5.1.20
1818

1919
ADD etc/infrastructure/php/extensions/rabbitmq.sh /root/install-rabbitmq.sh
2020
ADD etc/infrastructure/php/extensions/xdebug.sh /root/install-xdebug.sh

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ rebuild: composer-env-file
8181
ping-mysql:
8282
@docker exec codelytv-php_ddd_skeleton-mooc-mysql mysqladmin --user=root --password= --host "127.0.0.1" ping --silent
8383

84+
.PHONY: ping-rabbitmq
85+
ping-rabbitmq:
86+
@docker exec codelytv-php_ddd_skeleton-rabbitmq rabbitmqctl ping --silent
87+
8488
clean-cache:
8589
@rm -rf apps/*/*/var
8690
@docker exec codelytv-php_ddd_skeleton-backoffice_backend-php ./apps/backoffice/backend/bin/console cache:warmup

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ services:
2727

2828
mooc_mysql:
2929
container_name: codelytv-php_ddd_skeleton-mooc-mysql
30-
image: mysql:8.0
30+
image: mariadb:10.6
3131
ports:
3232
- 3360:3306
3333
environment:

etc/infrastructure/php/extensions/rabbitmq.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
git clone https://github.com/php-amqp/php-amqp.git
1+
git clone --depth 1 --branch v1.11.0beta https://github.com/php-amqp/php-amqp.git
22
cd php-amqp
33
phpize
44
./configure

etc/infrastructure/php/extensions/xdebug.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
git clone -n https://github.com/xdebug/xdebug.git
1+
git clone --depth 1 --branch 3.0.4 https://github.com/xdebug/xdebug.git
22
cd xdebug
33
git checkout 592ab9fa10cfa132623489511e92ef69fb91744c
44
phpize

0 commit comments

Comments
 (0)