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?

1 Like

I’ve been thinking more about this and I think the real question is how can I install Redis from PECL in this pipeline?

1 Like

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

1 Like