Skip to content

Commit 3b8aa17

Browse files
committed
Update ci/cd scripts
1 parent 24925af commit 3b8aa17

3 files changed

Lines changed: 17 additions & 20 deletions

File tree

scripts/build-and-verify-cli-images.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ for i in ./build/*/; do
3434
echo "${text_bold}* Building ${image} ${text_normal}"
3535

3636
# Builds image and check for return code
37-
if [ "$(docker build --pull -t "${image}" "./build/${version}")" -eq 0 ]; then
37+
if ! docker build --pull -t "${image}" "./build/${version}"; then
3838
echo "${text_bold}${text_red}* ERROR when building ${image} ${text_normal}"
3939
exit 1
4040
fi
@@ -46,7 +46,5 @@ for i in ./build/*/; do
4646
--workdir /app \
4747
--entrypoint php \
4848
"${image}" test-xdebug-install.php
49-
50-
exit 0
5149
done
5250

scripts/git-has-changes.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#!/usr/bin/env sh
1+
#!/usr/bin/env bash
22

3-
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
3+
if [[ -n $(git status --porcelain --untracked-files=no) ]]; then
44
exit 1
55
fi

scripts/test-xdebug-install.php

100644100755
Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
<?php
22

3-
function testPhpinfo() {
4-
ob_start();
5-
phpinfo();
6-
$phpinfo = ob_get_flush();
3+
function checkExtensionLoaded() {
4+
if (!extension_loaded('xdebug')) {
5+
exit(1);
6+
}
77
}
88

9-
function testVardump() {
10-
11-
}
12-
13-
function testXdebugIsDebuggerActive() {
14-
// xdebug_is_debugger_active
15-
// https://xdebug.org/docs/all_functions#xdebug_is_debugger_active
9+
function checkXdebugIsDebuggerActive() {
10+
if (!function_exists('xdebug_is_debugger_active')) {
11+
exit(1);
12+
}
13+
$result = xdebug_is_debugger_active();
14+
if (!is_bool($result)) {
15+
exit(1);
16+
}
1617
}
1718

18-
19-
20-
21-
// https://stackoverflow.com/questions/14046501/check-if-xdebug-is-working
19+
checkExtensionLoaded();
20+
checkXdebugIsDebuggerActive();

0 commit comments

Comments
 (0)