【问题标题】:What are the applicable 'cloudbuild.yaml' steps to deploy a Java App to Google App Engine Standard edition?将 Java 应用程序部署到 Google App Engine 标准版的适用“cloudbuild.yaml”步骤是什么?
【发布时间】:2020-04-30 00:03:22
【问题描述】:

将 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.

【问题讨论】:

    标签: google-cloud-build


    【解决方案1】:

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

    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>
    

    【讨论】:

    • 顺便说一句,您遇到过这个问题吗? Step #0 - "Stage app using mvn appengine plugin": /root/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/install.sh: line 180: python: command not found
    猜你喜欢
    • 2017-05-27
    • 2021-09-23
    • 2016-09-15
    • 1970-01-01
    • 1970-01-01
    • 2014-07-27
    • 1970-01-01
    • 1970-01-01
    • 2015-05-06
    相关资源
    最近更新 更多