-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[6.x] Added a way to run the CI tests locally (#31551)
* Added a way to run the CI tests locally * Update test.sh Co-authored-by: Taylor Otwell <taylor@laravel.com>
- Loading branch information
1 parent
83e8e7b
commit c1b6dae
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
docker-compose down -t 0 &> /dev/null | ||
docker-compose up -d | ||
|
||
echo "Waiting for services to boot..." | ||
|
||
if docker run -it --rm registry.gitlab.com/grahamcampbell/php:7.4-base -r "\$tries = 0; while (true) { try { \$tries++; if (\$tries > 30) { throw new RuntimeException('MySQL never became available'); } sleep(1); new PDO('mysql:host=docker.for.mac.localhost;dbname=forge', 'root', '', [PDO::ATTR_TIMEOUT => 3]); break; } catch (PDOException \$e) {} }"; then | ||
if docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit \ | ||
--env CI=1 --env DB_HOST=docker.for.mac.localhost \ | ||
--env REDIS_HOST=docker.for.mac.localhost --env REDIS_PORT=6379 \ | ||
--env MEMCACHED_HOST=docker.for.mac.localhost --env MEMCACHED_PORT=11211 \ | ||
--rm registry.gitlab.com/grahamcampbell/php:7.4-base "$@"; then | ||
docker-compose down -t 0 | ||
else | ||
docker-compose down -t 0 | ||
exit 1 | ||
fi | ||
else | ||
docker-compose logs | ||
docker-compose down -t 0 &> /dev/null | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: '3' | ||
services: | ||
memcached: | ||
image: memcached:1.5-alpine | ||
ports: | ||
- "11211:11211" | ||
restart: always | ||
mysql: | ||
image: mysql:5.7 | ||
environment: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: 1 | ||
MYSQL_ROOT_PASSWORD: "" | ||
MYSQL_DATABASE: "forge" | ||
ports: | ||
- "3306:3306" | ||
restart: always | ||
redis: | ||
image: redis:5.0-alpine | ||
ports: | ||
- "6379:6379" | ||
restart: always |