0

The docs say:

At deployment, before starting your application, you can perform a custom build step by adding a gcp-build script in your package.json file.

"At deployment" makes me think it runs it when you run gcloud app deploy - but some of the rest of the page makes it sound like it's run when each instance is started.

Kenmore
  • 1,525
  • 3
  • 16
  • 39

2 Answers2

1

The custom built step will be executed when each instance is created.

The deploy includes the end to end process, meaning it starts by gathering your code/scripts, creating instances and customization, which is the build step and sending your code to the instances.

This doc can give you more details on this specific command

Ralemos
  • 5,571
  • 2
  • 9
  • 18
  • Yeah that documentation still doesn't make it explicit as far as I can tell but I've done a test and verified this is true. I have 2 follow up questions, not sure if you would know (maybe I should make a separate question): 1, Does App Engine wait for `gcp-build` to finish? If so what is the timeout? and 2, What happens if you throw an error during the build? Does it still launch the app? – Kenmore Feb 11 '20 at 17:18
  • I can answer in the comments, no problem with that. So, app engine does wait for the build and the timeout can be set in the build configuration, the default is 10 minutes, as referenced in this [link](https://cloud.google.com/cloud-build/docs/api/reference/rest/Shared.Types/Build) – Ralemos Feb 12 '20 at 09:01
  • As per the error in the build, I couldn't find anything specific on the documentation for gcp but from what I seen it does not launch the app, because it could generate error on the instances already running of the app, if there are any. – Ralemos Feb 12 '20 at 09:14
0

According to the docs it runs at deployment, meaning it runs every time a new build is done.

Alex MAN
  • 111
  • 1
  • 6