Name: php-tools
Owner: Google Cloud Platform
Description: null
Created: 2016-05-06 21:32:18.0
Updated: 2018-04-28 14:33:09.0
Pushed: 2018-04-25 00:54:46.0
Homepage: null
Size: 62
Language: PHP
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Add google/cloud-tools
to the require-dev
section of your
composer.json
.
You can also run the following command:
mposer require google/cloud-tools --dev
The cli script src/Utils/Flex/flex_exec
is a tool for running a
command with using the same Docker image as the application running on
App Engine Flex.
It spins up a Docker image of a Deployed App Engine Flexible App, and
runs a command in that image. For example, if you are running Laravel
application, you can invoke a command like php artisan migrate
in
the image.
If the Flex application is requesting the cloudsql access
(beta_settings
, cloud_sql_instances
), this tool also provides the
connection to the same Cloud SQL instances.
The command runs on virtual machines provided by Google Cloud Container Builder, and has access to the credentials of the Cloud Container Builder service account.
To use flex_exec, you will need:
google/cloud-tools
composer packageYou may also need to grant the Cloud Container Builder service account
any permissions needed by your command. For accessing Cloud SQL, you
need to add Cloud SQL Client
permission to the service account.
You can find the service account configuration in the IAM tab in the
Cloud Console under the name [your-project-number]@cloudbuild.gserviceaccount.com
.
The tool uses virtual machine resources provided by Google Cloud Container Builder. Although a certain number of usage minutes per day is covered under a free tier, additional compute usage beyond that time is billed to your Google Cloud account. For more details, see: https://cloud.google.com/container-builder/pricing
If your command makes API calls or utilizes other cloud resources, you
may also be billed for that usage. However, flex_exec
does not use
actual App Engine instances, and you will not be billed for additional
App Engine instance usage.
Utils/Flex/flex_exec run -- php artisan migrate
There are various test utilities in the Google\Cloud\TestUtils
namespace.
The example test cases are available in
test/fixtures/appengine-standard
directory.
There are multiple environment variables to control the behavior of our test traits.
RUN_DEVSERVER_TESTS
:
Set to true
if you want to run tests with DevAppserverTestTraitPHP_CGI_PATH
:
Path to php-cgi
for running dev_appserverLOCAL_TEST_TARGETS
:
You can specify multiple yaml files if your test need multiple services.RUN_DEPLOYMENT_TESTS
:
Set to true
if you want to run tests with AppEngineDeploymentTraitGOOGLE_PROJECT_ID
:
The project id for deploying the applicationGOOGLE_VERSION_ID
:
The version id for deploying the application