Skip to content

Commit

Permalink
Merge branch 'release/1.0.14'
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Apr 26, 2023
2 parents e2ec069 + 7a29b39 commit d1b05ef
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
22 changes: 15 additions & 7 deletions .docker-config/php/run_queue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,25 @@
# @license MIT

cd /var/www/project
# Wait until the `composer install` is done by looking for the `vendor/autoload.php` file
echo "### Waiting for vendor/autoload.php"
while [ ! -f "composer.lock" ] || [ ! -d "vendor" ] || [ ! -f "vendor/autoload.php" ]
do
sleep 5
done
# Wait until the MySQL db container responds
echo "### Waiting for MySQL database"
until eval "mysql -h mysql -u $CRAFT_DB_USER -p$CRAFT_DB_PASSWORD $CRAFT_DB_DATABASE -e 'select 1' > /dev/null 2>&1"
COMMAND="mysql -h mysql -u $CRAFT_DB_USER -p$CRAFT_DB_PASSWORD $CRAFT_DB_DATABASE -se 'SELECT EXISTS(SELECT * FROM info)'"
# First wait until the command runs without error
until eval "$COMMAND > /dev/null 2>&1"
do
sleep 1
echo "### Waiting for MySQL database"
sleep 5
done
# Wait until the `composer install` is done by looking for the `vendor/autoload.php` file
echo "### Waiting for vendor/autoload.php"
while [ ! -f vendor/autoload.php ]
# Second wait until content in the `info` table exists
until [ $(eval "$COMMAND") != "0" ]
do
sleep 1
echo "### Waiting for database 'info' table"
sleep 5
done
# Ensure permissions on directories Craft needs to write to
chown -R www-data:www-data /var/www/project/storage
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# nystudio107/spin-up-craft Change Log

## 1.0.14 - 2023.04.25
### Fixed
* Wait not just for the database to be available, but also that the `info` table has been populated before proceeding with the `queue` container ([#2](https://github.com/nystudio107/spin-up-craft/issues/2))

### Changed
* Remove PHP platform version

## 1.0.13 - 2023.03.30
### Changed
* Clean up the `Makefile` by using `docker compose` api
Expand Down
5 changes: 1 addition & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
"craftcms/plugin-installer": true,
"yiisoft/yii2-composer": true
},
"sort-packages": true,
"platform": {
"php": "8.0.2"
}
"sort-packages": true
}
}
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ services:
*php-build
command: /var/www/run_queue.sh
depends_on:
- "php"
- "mysql"
env_file:
*env_file
environment:
Expand Down

0 comments on commit d1b05ef

Please sign in to comment.