Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Can't run a particular script during PHP GAE build

I've modified the yaml file with the instructions to build our app so that it includes a step to generate the keys:

- id: 'create-lexikjwt-keys'
waitFor: [ 'composer-install' ]
name: 'php:7.4'
dir: 'app'
args: [ 'bin/console', 'lexik:jwt:generate-keypair' ]

It fails with the following error:

In RedisTrait.php line 103:

                                                                               

  Cannot find the "redis" extension nor the "predis/predis" package: "redis:/  

  /localhost:6379/1".        

Running bin/console lexik:jwt:generate-keypair locally works.

Here is a similar step that has always worked (now it gets enqueued after the new one so I can't see the result, but I presume it would still work):

- id: 'console-clear'
waitFor: [ 'composer-install' ]
name: 'php:7.4'
dir: 'app'
args: [ 'bin/console', 'cache:clear', '--env=build', '--no-warmup' ]

I'm guessing this one works because it just does a series of rm commands and it doesn't need to instantiate SF dependencies.
Why aren't those available for the new command? Is the result of the composer-install step no available to it?

Solved Solved
1 2 385
1 ACCEPTED SOLUTION

I'm using  a custom builder for that step, so PHP has Redis enabled. I'll close this.

View solution in original post