Skip to content

Commit d9d1600

Browse files
authored
Merge pull request #178 from bryanlatten/upgrade-cmd-bash
Command: fixing bash check for variable
2 parents f86d6bb + e492548 commit d9d1600

8 files changed

Lines changed: 50 additions & 6 deletions

File tree

container/root/etc/services-available/php-fpm/.command

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
# Ensures that a failure of php-fpm doesn't return with a 0, even if the right-hand side does
44
set -o pipefail
55

6-
# IMPORTANT: PHP 7.3+ optionally allows undecorated stdout/stderr, removing pipe magic requirement
7-
UPGRADE_COMMAND=`grep "decorate_workers_output = no" $CONF_FPMPOOL`
6+
# IMPORTANT: PHP 7.3+ optionally allows undecorated stdout/stderr, removes requirement for legacy post-filtering
7+
grep "decorate_workers_output = no" "$CONF_FPMPOOL" 1>/dev/null
8+
_RETVAL=$?
89

9-
if [ $UPGRADE_COMMAND ]; then
10+
if [[ "${_RETVAL}" == "0" ]]; then
11+
echo '[php-fpm] launching...'
1012
exec php-fpm -F -O
1113
else
14+
echo '[php-fpm] launching...with legacy filtered stdout'
1215
exec php-fpm -F -O 2>&1 | sed -u 's,.*: \"\(.*\)$,\1,'| sed -u 's,\"$,,'
1316
fi
14-
15-
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
file:
2+
/goss/docker_output.log:
3+
exists: true
4+
filetype: file # file, symlink, directory
5+
contains: # Check file content for these patterns
6+
- '/legacy filtered stdout/'
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
file:
2+
/goss/docker_output.log:
3+
exists: true
4+
filetype: file # file, symlink, directory
5+
contains: # Check file content for these patterns
6+
- '/legacy filtered stdout/'
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
file:
2+
/goss/docker_output.log:
3+
exists: true
4+
filetype: file # file, symlink, directory
5+
contains: # Check file content for these patterns
6+
- '/legacy filtered stdout/'
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
file:
2+
/goss/docker_output.log:
3+
exists: true
4+
filetype: file # file, symlink, directory
5+
contains: # Check file content for these patterns
6+
- '/launching...$/'
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
file:
2+
/goss/docker_output.log:
3+
exists: true
4+
filetype: file # file, symlink, directory
5+
contains: # Check file content for these patterns
6+
- '/launching...$/'
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
file:
2+
/goss/docker_output.log:
3+
exists: true
4+
filetype: file # file, symlink, directory
5+
contains: # Check file content for these patterns
6+
- '/launching...$/'

test.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,14 @@ echo "${PREFIX} Send uploaded file"
7979
curl --form upload=@tmp.txt "${MACHINE}:${CONTAINER_PORT}" \
8080
| grep "PHP Version ${PHP_VERSION}." > /dev/null
8181

82-
echo "${PREFIX} Perform runtime tests"
82+
echo "${PREFIX} Perform startup tests"
83+
GOSS_PATH=goss \
84+
GOSS_SLEEP=5 \
85+
GOSS_FILES_PATH="runtime-tests/startup/${PHP_VARIANT}/" \
86+
./dgoss run \
87+
"${DOCKER_TAG}:latest"
88+
89+
echo "${PREFIX} Perform NewRelic runtime tests"
8390
GOSS_PATH=goss \
8491
GOSS_FILES_PATH="runtime-tests/newrelic/${PHP_VARIANT}/" \
8592
./dgoss run \

0 commit comments

Comments
 (0)