Skip to content
This repository was archived by the owner on Oct 19, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions builder/gen-dockerfile/src/ValidateGoogleCloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,19 @@ public static function doCheck($workspace)
"no available matching version of $package"
);
}
$found = false;
foreach ($filtered as $version) {
if (Comparator::lessThan($version, $minimumVersionMap[$package])) {
throw new GoogleCloudVersionException(
"stackdriver integration needs $package "
. $minimumVersionMap[$package] . ' or higher'
);
if (Comparator::greaterThanOrEqualTo($version, $minimumVersionMap[$package])) {
$found = true;
break;
}
}
if ($found === false) {
throw new GoogleCloudVersionException(
"stackdriver integration needs $package "
. $minimumVersionMap[$package] . ' or higher'
);
}
}

if (array_key_exists('google/cloud', $constraintsMap)) {
Expand Down
17 changes: 16 additions & 1 deletion builder/gen-dockerfile/tests/GenFilesCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,21 @@ public function dataProvider()
"enable_stackdriver_integration.sh"
]
],
[
// stackdriver wildcard dep
__DIR__ . '/test_data/stackdriver_wildcard',
null,
'',
'/app/web',
'added by the php runtime builder',
'gcr.io/google-appengine/php72:latest',
["COMPOSER_FLAGS='--no-dev --prefer-dist' \\\n",
"FRONT_CONTROLLER_FILE='index.php' \\\n",
"DETECTED_PHP_VERSION='7.2' \\\n",
"IS_BATCH_DAEMON_RUNNING='true' \n",
"enable_stackdriver_integration.sh"
]
],
[
// stackdriver individual packages
__DIR__ . '/test_data/stackdriver_individual',
Expand All @@ -224,7 +239,7 @@ public function dataProvider()
'',
'/app/web',
'added by the php runtime builder',
'gcr.io/google-appengine/php71:latest',
'gcr.io/google-appengine/php72:latest',
[],
'\\Google\\Cloud\\Runtimes\\Builder\\Exception\\GoogleCloudVersionException'
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"google/cloud-logging": "^1.2.0",
"google/cloud-logging": "<=1.2.0",
"google/cloud-error-reporting": "^0.4.1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
env: flex
runtime: php

runtime_config:
enable_stackdriver_integration: true
document_root: web
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"google/cloud": "*"
}
}