Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit af667ab

Browse files
committedOct 9, 2021
sed with DB_DSN must always match
1 parent 6178f96 commit af667ab

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎.github/workflows/test-unit.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ jobs:
144144
php -r '(new PDO("mysql:host=mariadb", "root", "atk4_pass_root"))->exec("ALTER USER '"'"'atk4_test_user'"'"'@'"'"'%'"'"' WITH MAX_USER_CONNECTIONS 5");'
145145
php -r '(new PDO("pgsql:host=postgres;dbname=atk4_test", "atk4_test_user", "atk4_pass"))->exec("ALTER ROLE atk4_test_user CONNECTION LIMIT 1");'
146146
if [ -n "$LOG_COVERAGE" ]; then mkdir coverage && cp tools/CoverageUtil.php demos; fi
147-
sed -E "s/\(('sqlite:.+)\);/(\$_ENV['DB_DSN'] ?? \\1, \$_ENV['DB_USER'] ?? null, \$_ENV['DB_PASSWD'] ?? null);/g" -i demos/db.default.php
147+
sed -E "s/\(('sqlite:.+)\);/(\$_ENV['DB_DSN'] ?? \\1, \$_ENV['DB_USER'] ?? null, \$_ENV['DB_PASSWD'] ?? null);/g; t; q1" -i demos/db.default.php
148148
149149
- name: "Run tests: SQLite (only for Phpunit)"
150150
if: startsWith(matrix.type, 'Phpunit')
@@ -344,7 +344,7 @@ jobs:
344344
php -r '(new PDO("mysql:host=mariadb", "root", "atk4_pass_root"))->exec("ALTER USER '"'"'atk4_test_user'"'"'@'"'"'%'"'"' WITH MAX_USER_CONNECTIONS 5");'
345345
php -r '(new PDO("pgsql:host=postgres;dbname=atk4_test", "atk4_test_user", "atk4_pass"))->exec("ALTER ROLE atk4_test_user CONNECTION LIMIT 1");'
346346
if [ -n "$LOG_COVERAGE" ]; then mkdir coverage && cp tools/CoverageUtil.php demos; fi
347-
sed -E "s/\(('sqlite:.+)\);/(\$_ENV['DB_DSN'] ?? \\1, \$_ENV['DB_USER'] ?? null, \$_ENV['DB_PASSWD'] ?? null);/g" -i demos/db.default.php
347+
sed -E "s/\(('sqlite:.+)\);/(\$_ENV['DB_DSN'] ?? \\1, \$_ENV['DB_USER'] ?? null, \$_ENV['DB_PASSWD'] ?? null);/g; t; q1" -i demos/db.default.php
348348
sed -i "s~'https://raw.githack.com/atk4/ui/develop/public.*~'/public',~" src/App.php
349349
php -S 172.18.0.2:8888 > /dev/null 2>&1 &
350350
sleep 0.2

‎demos/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ COPY demos demos
4343

4444
COPY demos/db.default.php demos
4545
RUN php demos/_demo-data/create-db.php
46-
RUN sed -E "s/\(('sqlite:.+)\);/(\$_ENV['DB_DSN'] ?? \\1, \$_ENV['DB_USER'] ?? null, \$_ENV['DB_PASSWD'] ?? null);/g" -i demos/db.default.php
46+
RUN sed -E "s/\(('sqlite:.+)\);/(\$_ENV['DB_DSN'] ?? \\1, \$_ENV['DB_USER'] ?? null, \$_ENV['DB_PASSWD'] ?? null);/g; t; q1" -i demos/db.default.php

0 commit comments

Comments
 (0)
Please sign in to comment.