【问题标题】:Bitbucket to Google App Engine Deployment failed - ERROR: (gcloud.app.deploy) [/opt/atlassian/pipelines/agent/build/app.yaml] does not existBitbucket 到 Google App Engine 部署失败 - 错误:(gcloud.app.deploy) [/opt/atlassian/pipelines/agent/build/app.yaml] 不存在
【发布时间】:2020-09-29 17:24:29
【问题描述】:

我正在尝试从 Bitbucket Pipelines 将 Spring Boot 微服务应用程序部署到 Google App Engine。提交代码后出现以下错误,

INFO: Setting up environment.
echo "${KEY_FILE}" | base64 -d >> /tmp/key-file.json  
gcloud auth activate-service-account --key-file /tmp/key-file.json --quiet --verbosity=warning  
Activated service account credentials for: [testproject-iamserviceaccoun@testproject.iam.gserviceaccount.com]  
gcloud config set project testproject --quiet --verbosity=warning  
Updated property [core/project].  

> *INFO: Starting deployment to GCP app engine...*  
gcloud app --quiet deploy 'app.yaml' --verbosity=warning  
**ERROR: (gcloud.app.deploy) [/opt/atlassian/pipelines/agent/build/app.yaml] does not exist.  
✖ Deployment failed.**

请帮我解决这个问题。使用的构建工具是 Maven。

bitbucket-pipelines.yml:

pipelines:
  default:
     - step: 
        name: Deploy to Google cloud
        deployment: test
        script: 
          - pipe: atlassian/google-app-engine-deploy:0.7.3
            variables: 
              KEY_FILE: $KEY_FILE
              PROJECT: 'testproject'

src/main/appengine/app.yaml:

runtime: java
env: flex

handlers:
- url: /.*
  script: this field is required, but ignored

【问题讨论】:

    标签: java google-app-engine google-cloud-platform gcloud bitbucket-pipelines


    【解决方案1】:

    您需要在 bitbucket-pipelines.yml 中指定 DEPLOYABLES,指向您的 app.yaml 文件的路径。

    pipelines:
      default:
         - step: 
            name: Deploy to Google cloud
            deployment: test
            script: 
              - pipe: atlassian/google-app-engine-deploy:0.7.3
                variables: 
                  KEY_FILE: $KEY_FILE
                      PROJECT: 'testproject'
                      DEPLOYABLES: src/main/appengine/app.yaml
    

    参考:https://bitbucket.org/atlassian/google-app-engine-deploy/src/master/

    【讨论】:

    • “官方”appengine-maven 示例包含DEPLOYABLES: 'target/appengine-staging/app.yaml'(实际上包含构建项目后的 app.yaml 文件)有点奇怪,但它没有找到该文件。将目标文件夹定义为工件并期望 appengine 从那里开始更有意义。我会从 src 试试,谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-06-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-06
    • 2021-03-18
    • 1970-01-01
    相关资源
    最近更新 更多