diff --git a/builder/gen-dockerfile/src/Builder/GenFilesCommand.php b/builder/gen-dockerfile/src/Builder/GenFilesCommand.php index 513d579d..7432ae88 100644 --- a/builder/gen-dockerfile/src/Builder/GenFilesCommand.php +++ b/builder/gen-dockerfile/src/Builder/GenFilesCommand.php @@ -184,6 +184,7 @@ protected function envsFromRuntimeConfig() ? $this->appYaml['env_variables'] : []; $maps = [ + 'builder_debug_output' => 'BUILDER_DEBUG_OUTPUT', 'document_root' => 'DOCUMENT_ROOT', 'enable_stackdriver_integration' => self::STACKDRIVER_INTEGRATION_ENV, 'front_controller_file' => 'FRONT_CONTROLLER_FILE', @@ -212,6 +213,12 @@ protected function envsFromRuntimeConfig() // Otherwise prepend the app dir. $ret[$v] = self::APP_DIR . '/' . $runtimeConfig[$k]; } + } elseif ($v === 'BUILDER_DEBUG_OUTPUT') { + $ret[$v] = filter_var( + $runtimeConfig[$k], FILTER_VALIDATE_BOOLEAN + ) + ? 'true' + : 'false'; } else { $ret[$v] = $runtimeConfig[$k]; } diff --git a/php-base/build-scripts/composer.sh b/php-base/build-scripts/composer.sh index 7213f91b..2d1dc22b 100644 --- a/php-base/build-scripts/composer.sh +++ b/php-base/build-scripts/composer.sh @@ -16,7 +16,12 @@ # A shell script for installing dependencies with composer. -set -xe + +if [ "${BUILDER_DEBUG_OUTPUT}" = "true" ]; then + set -xe +else + set -e +fi DEFAULT_PHP_VERSION="7.1" @@ -24,10 +29,10 @@ if [ -f ${APP_DIR}/composer.json ]; then if [ -n "${DETECTED_PHP_VERSION}" ]; then PHP_VERSION="${DETECTED_PHP_VERSION}" else + echo "Detecting PHP version..." # Extract php version from the composer.json. CMD="php /build-scripts/detect_php_version.php ${APP_DIR}/composer.json" PHP_VERSION=`su www-data -c "${CMD}"` - echo "PHP_VERSION: ${PHP_VERSION}" if [ "${PHP_VERSION}" == "exact" ]; then cat<