将 Java 应用程序部署到 Google App Engine 标准版的适用 'cloudbuild.yaml' 步骤是什么?

What are the applicable 'cloudbuild.yaml' steps to deploy a Java App to Google App Engine Standard edition?

将 Java 应用程序部署到 Google App Engine 标准版的适用 'cloudbuild.yaml' 步骤是什么?

我在文档中找不到与此相关的任何内容。

我正在尝试:

steps:
  - name: 'gcr.io/cloud-builders/mvn'
    args: [ 'install', '--settings', 'settings.xml' ]
  - name: 'gcr.io/cloud-builders/gcloud'
    args: [ 'app', 'deploy' ]
    timeout: '6m0s'

第一步成功,但第二步失败,并显示这条没有帮助的消息:

Already have image (with digest): gcr.io/cloud-builders/gcloud
ERROR: gcloud crashed (AttributeError): 'NoneType' object has no attribute 'endswith'

我应该改用 maven 部署命令 'mvn appengine:deploy' 吗?

提前致谢。


第二次尝试:

steps:
  - name: 'gcr.io/cloud-builders/mvn'
    args: [ '--define', 'skipTests', '--settings', 'settings.xml', 
'clean', 'package', 'appengine:deploy' ]
    timeout: '6m0s'

结果如下:

Execution default-cli of goal 
com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy 
failed: 
The Google Cloud SDK could not be found 
in the customary locations and no path was provided.

我在以下位置找到了答案:

https://medium.com/@Leejjon_net/use-cloud-build-to-do-continuous-delivery-for-your-java-project-on-app-engine-3c59072547ca

steps:
  - id: 'Stage app using mvn appengine plugin'
    name: 'gcr.io/cloud-builders/mvn'
    args: [ '--define', 'skipTests', '--settings', 'settings.xml', 'package', 'appengine:stage' ]
  - id: 'Deploy to app engine'
    name: 'gcr.io/cloud-builders/gcloud'
    args: [ 'app', 'deploy', 'target/appengine-staging/app.yaml' ]

此外,请确保插件版本为:

   <plugin>
       <groupId>com.google.cloud.tools</groupId>
       <artifactId>appengine-maven-plugin</artifactId>
       <version>2.2.0</version>
   </plugin>