File tree 14 files changed +67
-110
lines changed
14 files changed +67
-110
lines changed Original file line number Diff line number Diff line change
1
+ PROJECT_NAME=symfony-based-phone-checker
1
2
HTTP_PORT=80
2
3
3
4
PHP_VERSION=7.4
Original file line number Diff line number Diff line change
1
+ ENABLE_XDEBUG = 1
Original file line number Diff line number Diff line change @@ -37,7 +37,19 @@ setup:
37
37
@cp -n docker-compose.override.yml.dist docker-compose.override.yml
38
38
39
39
tests : setup
40
- @cd ./tests && make run
40
+ @docker-compose -p ${PROJECT_NAME} _testing -f docker-compose.yml -f docker-compose.testing.yml up -d
41
+ @docker-compose -p ${PROJECT_NAME} _testing exec -T web bash /wait-for.sh --timeout=30 localhost:80 -- echo " Webserver started"
42
+ @docker-compose -p ${PROJECT_NAME} _testing exec -T php ./vendor/bin/codecept run
43
+ @docker-compose -p ${PROJECT_NAME} _testing stop
41
44
42
45
coverage : setup
43
- @cd ./tests && make coverage
46
+ @docker-compose -p ${PROJECT_NAME} _testing -f docker-compose.yml -f docker-compose.testing.yml up -d
47
+ @docker-compose -p ${PROJECT_NAME} _testing exec -T web bash /wait-for.sh --timeout=30 localhost:80 -- echo " Webserver started"
48
+ @docker-compose -p ${PROJECT_NAME} _testing exec -T php ./vendor/bin/codecept run --coverage --coverage-xml
49
+ @docker-compose -p ${PROJECT_NAME} _testing stop
50
+
51
+ ci : setup
52
+ @docker-compose -p ${PROJECT_NAME} _testing -f docker-compose.yml -f docker-compose.testing.yml up -d
53
+ @docker-compose -p ${PROJECT_NAME} _testing exec -T web bash /wait-for.sh --timeout=30 localhost:80 -- echo " Webserver started"
54
+ @docker-compose -p ${PROJECT_NAME} _testing exec -T php ./vendor/bin/grumphp run --testsuite=ci
55
+ @docker-compose -p ${PROJECT_NAME} _testing stop
Original file line number Diff line number Diff line change
1
+ version : " 3"
2
+ services :
3
+ web :
4
+ container_name : ${PROJECT_NAME}_web_testing
5
+ env_file :
6
+ - " .env.testing"
7
+ php :
8
+ container_name : ${PROJECT_NAME}_php_testing
9
+ env_file :
10
+ - " .env.testing"
11
+ mysql :
12
+ container_name : ${PROJECT_NAME}_mysql_testing
13
+ volumes :
14
+ - " ./data/testing/mysql:/var/lib/mysql"
15
+ env_file :
16
+ - " .env.testing"
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
echo ' Run start.sh'
3
3
4
- bash /wait-for.sh php:9000 -t 0 -- echo " Php fpm started"
4
+ bash /wait-for.sh php:9000 --timeout=30 -- echo " Php fpm started"
5
5
6
6
nginx -g ' daemon off;'
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
- # Use this script to test if a given TCP host/port are available
2
+ # Use this script to test if a given TCP host/port are available
3
3
4
4
WAITFORIT_cmdname=${0##*/ }
5
5
@@ -141,16 +141,20 @@ WAITFORIT_STRICT=${WAITFORIT_STRICT:-0}
141
141
WAITFORIT_CHILD=${WAITFORIT_CHILD:- 0}
142
142
WAITFORIT_QUIET=${WAITFORIT_QUIET:- 0}
143
143
144
- # check to see if timeout is from busybox?
144
+ # Check to see if timeout is from busybox?
145
145
WAITFORIT_TIMEOUT_PATH=$( type -p timeout)
146
146
WAITFORIT_TIMEOUT_PATH=$( realpath $WAITFORIT_TIMEOUT_PATH 2> /dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH )
147
+
148
+ WAITFORIT_BUSYTIMEFLAG=" "
147
149
if [[ $WAITFORIT_TIMEOUT_PATH =~ " busybox" ]]; then
148
- WAITFORIT_ISBUSY=1
150
+ WAITFORIT_ISBUSY=1
151
+ # Check if busybox timeout uses -t flag
152
+ # (recent Alpine versions don't support -t anymore)
153
+ if timeout & > /dev/stdout | grep -q -e ' -t ' ; then
149
154
WAITFORIT_BUSYTIMEFLAG=" -t"
150
-
155
+ fi
151
156
else
152
- WAITFORIT_ISBUSY=0
153
- WAITFORIT_BUSYTIMEFLAG=" "
157
+ WAITFORIT_ISBUSY=0
154
158
fi
155
159
156
160
if [[ $WAITFORIT_CHILD -gt 0 ]]; then
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ if [ $ENABLE_XDEBUG == "1" ]; then
9
9
docker-php-ext-enable xdebug
10
10
fi
11
11
12
- bash /wait-for.sh mysql:3306 -t 0 -- echo " Mysql started"
12
+ bash /wait-for.sh mysql:3306 --timeout=30 -- echo " Mysql started"
13
13
14
14
php ./bin/console doctrine:migrations:migrate --no-interaction
15
15
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
- # Use this script to test if a given TCP host/port are available
2
+ # Use this script to test if a given TCP host/port are available
3
3
4
4
WAITFORIT_cmdname=${0##*/ }
5
5
@@ -141,16 +141,20 @@ WAITFORIT_STRICT=${WAITFORIT_STRICT:-0}
141
141
WAITFORIT_CHILD=${WAITFORIT_CHILD:- 0}
142
142
WAITFORIT_QUIET=${WAITFORIT_QUIET:- 0}
143
143
144
- # check to see if timeout is from busybox?
144
+ # Check to see if timeout is from busybox?
145
145
WAITFORIT_TIMEOUT_PATH=$( type -p timeout)
146
146
WAITFORIT_TIMEOUT_PATH=$( realpath $WAITFORIT_TIMEOUT_PATH 2> /dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH )
147
+
148
+ WAITFORIT_BUSYTIMEFLAG=" "
147
149
if [[ $WAITFORIT_TIMEOUT_PATH =~ " busybox" ]]; then
148
- WAITFORIT_ISBUSY=1
150
+ WAITFORIT_ISBUSY=1
151
+ # Check if busybox timeout uses -t flag
152
+ # (recent Alpine versions don't support -t anymore)
153
+ if timeout & > /dev/stdout | grep -q -e ' -t ' ; then
149
154
WAITFORIT_BUSYTIMEFLAG=" -t"
150
-
155
+ fi
151
156
else
152
- WAITFORIT_ISBUSY=0
153
- WAITFORIT_BUSYTIMEFLAG=" "
157
+ WAITFORIT_ISBUSY=0
154
158
fi
155
159
156
160
if [[ $WAITFORIT_CHILD -gt 0 ]]; then
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 14
14
run : composer install --prefer-dist --no-progress --no-suggest --no-scripts
15
15
16
16
- name : Grumphp
17
- run : cd .docker/tests && make up && docker-compose exec -T php ./vendor/bin/grumphp run --testsuite= ci
17
+ run : cd .docker && make ci
Original file line number Diff line number Diff line change @@ -30,18 +30,18 @@ parameters:
30
30
priority : 300
31
31
git_commit_message :
32
32
enforce_capitalized_subject : false
33
- type_scope_conventions :
34
- - types :
35
- - build
36
- - ci
37
- - chore
38
- - docs
39
- - feat
40
- - fix
41
- - perf
42
- - refactor
43
- - test
44
- - scopes : []
33
+ type_scope_conventions :
34
+ - types :
35
+ - build
36
+ - ci
37
+ - chore
38
+ - docs
39
+ - feat
40
+ - fix
41
+ - perf
42
+ - refactor
43
+ - test
44
+ - scopes : []
45
45
phpstan :
46
46
ignore_patterns : [src/Migrations]
47
47
phplint : ~
You can’t perform that action at this time.
0 commit comments