Google App Engine(灵活的环境)可以在部署之前执行package.json中定义的构建步骤吗? [英] Can Google App Engine (flexible environment) perform a build step defined in package.json just before deployment?

查看:60
本文介绍了Google App Engine(灵活的环境)可以在部署之前执行package.json中定义的构建步骤吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到有关在灵活环境中构建步骤的任何文档.我唯一发现的是,部署后,App Engine将在您的 package.json 文件中运行 start 脚本,但是有可能使其运行 build 脚本优先?这是Heroku所做的,我想复制它.

I couldn't find any documentation about build steps on the flexible environment. Only thing I found is that App Engine will run the start script from your package.json file after deployment, but is it possible to make it run the build script first? This is what Heroku does and I want to replicate it.

推荐答案

您正在寻找的脚本是

What you're looking for is the script called gcp-build as this one can perform a custom build step at deployment, just before starting the application. While this is only documented for Standard Environment as of now (I've let the engineers know), there are multiple public resources that can confirm this works on both environments. See the following links as reference:

  1. https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/master/appengine/typescript

    这篇关于Google App Engine(灵活的环境)可以在部署之前执行package.json中定义的构建步骤吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆