google-cloud-php icon indicating copy to clipboard operation
google-cloud-php copied to clipboard

Datastore php dependencies - Uploading ~15k files to gcloud.

Open haywirephoenix opened this issue 3 years ago • 1 comments

Setting up a php file for use with Datastore, hosted on App Engine.

Following the installation of all the dependencies using Composer, the list is very large.

$ gcloud app deploy app.yaml ==Uploading 12447 files to gcloud.

I'm only using "Google\Cloud\Datastore\DatastoreClient" to check and add entities to the standard Datastore.

Are all of the included dependencies required, or is there a process to check and strip all the unused files?

Or am I doing something wrong? For example when running on App Engine, is there no need to upload any additional files?

haywirephoenix avatar Feb 22 '22 13:02 haywirephoenix

I think I resolved it. My final working .gitignore is as follows. Note the double asterisks and need to specify each subdir.

.gcloudignore:

vendor/*
vendor/google/*
vendor/google/cloud/*

!vendor/autoload.php
!vendor/composer/**
!vendor/google
!vendor/google/cloud
!vendor/google/cloud/Core
!vendor/google/cloud/Datastore
!vendor/google/cloud/Core/**
!vendor/google/cloud/Datastore/**
!vendor/google/crc32/**

I'll leave it here for anyone searching. It would be good to know if there was already an automated way to do this.

haywirephoenix avatar Feb 22 '22 13:02 haywirephoenix

Closing since there's no action it seems.

vishwarajanand avatar Apr 25 '23 14:04 vishwarajanand