简体   繁体   English

如何仅将受影响的 nx 服务部署到 GCP APP Engine

[英]How to deploy only an affected nx service to GCP APP Engine

Given that I have an NX application with multiple services, and I want to do continuous deployment of only affected service/s to App Engine, how can I point to a given service.yaml (or multiple) within the common cloudbuild.yaml for the project?鉴于我有一个具有多个服务的 NX 应用程序,并且我想仅将受影响的服务持续部署到 App Engine,我如何才能指向一个给定的service.yaml (或多个)在公共cloudbuild.yaml中项目?
Each service in the monorepo has its own service.yaml as describe here monorepo 中的每个服务都有自己的服务。yaml 如此所述
ex: My cloudbuild.yaml looks like:例如:我的cloudbuild.yaml看起来像:

steps:
- name: node
  entrypoint: npm
  args: ['install']
- name: node
  entrypoint: npm
  args: ['run', 'affected:build']
- name: 'gcr.io/cloud-builders/gcloud'
  args: ['app', 'deploy', 'dist/apps/express-app-1/service.yaml']
  timeout: '1600s'

In my code I am pointing to specific service which is hard-coded but I need it to depend on nx affected:build .在我的代码中,我指向的是硬编码的特定服务,但我需要它依赖于nx affected:build

Is there a way to do that, and to achieve continuous deployment with nx build:affected and Cloud Build triggers?有没有办法做到这一点,并使用nx build:affected和 Cloud Build 触发器实现持续部署?

From what I read so far there is no standardised or "official-the-NX" way of doing such things (yet).从我目前阅读的内容来看,还没有标准化或“官方的 NX”方式来做这些事情。

Have a look here in this discussion .在此讨论中查看此处。 It was the best "answer" I found for myself, so far...到目前为止,这是我为自己找到的最好的“答案”......

Maybe a quick and simple tip:也许是一个快速而简单的提示:

You could consume the output of print-affected in your CI in order to decide which apps need to be built / deployed.您可以在 CI 中使用print-affected的 output 以确定需要构建/部署哪些应用程序。

npx nx print-affected --type=app --select=projects

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM