[英]How can I deploy my application within a cloned repository on Google App Engine?
I'm using a node package to run a web server (among other benefits) for my project. 我正在使用节点程序包为我的项目运行Web服务器(还有其他好处)。 The catch is, my project is only loaded on the server if it's within a directory of the node package.
问题是,如果我的项目位于节点包的目录中,则仅将其加载到服务器上。 In other words, my directory structure looks like this:
换句话说,我的目录结构如下所示:
<npm_pkg>/
<npm_pkg_src>/
clients/
<my_project_name>/
<my_project_src>
I would like to be able to use standard deployment processes for my project (eg gcloud app deploy
, Travis continuous deployment, etc.), but I need to run my project from within a subdirectory of the larger package. 我希望能够对我的项目使用标准的部署过程(例如
gcloud app deploy
,Travis连续部署等),但是我需要从较大包的子目录中运行我的项目。 Is there an easy way to force a git clone <pkg>
during a build step and deploy my project in the target subdirectory? 有没有一种简单的方法可以在构建步骤中强制
git clone <pkg>
并将我的项目部署到目标子目录中?
I'm pretty new to CI/CD, but I tried to search around for similar examples and couldn't find any. 我对CI / CD还是很陌生,但是我尝试搜索类似的示例,但找不到任何示例。 Note: the parent project is not owned by me and thus I can't just use submodules without forking it (and I have no intention to alter it in any way).
注意:父项目不是我所有的,因此我不能不分叉就使用子模块(并且我无意以任何方式对其进行更改)。 I also strictly just want to be able to trigger deploys based on my actual project's repository, if possible, whereas submodules would involve maintaining two and committing features twice (from what I understand).
我还严格只希望能够在可能的情况下基于实际项目的存储库触发部署,而子模块将涉及维护两次并提交两次功能(据我了解)。
Any help is much appreciated. 任何帮助深表感谢。
Edit: I forgot to mention that as part of this configuration I also need to run my server script from the root of the parent package. 编辑:我忘了提到,作为此配置的一部分,我还需要从父程序包的根目录运行服务器脚本。 IOW, my
package.json
's start script will look like "start": "cd ../.. && npm start"
. 哎呀,我的
package.json
的启动脚本看起来像"start": "cd ../.. && npm start"
。 Just in case it's relevant. 以防万一它是相关的。
This might be what you're looking for: CI/CD with App Engine 这可能是您要寻找的: 带有App Engine的CI / CD
Clone from the repo and deploy from the subdirectory it is located, and Cloud Source Repositories can automate the whole process for you 从存储库克隆并从其所在的子目录进行部署, Cloud Source Repository可以为您自动化整个过程
I would also suggest you keep services separate, this will make things clearer for you and others that will/might be working on the project with you 我还建议您将服务分开,这样可以使您和其他可能/可能与您一起进行项目工作的人更清楚
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.