Google Cloud Build找不到Python venv。。。用于Java Spring启动项目

2024-06-16 14:31:01 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个普通的Java11Spring启动应用程序,目前已部署到Heroku

我可以通过对gcloud app deploy的本地调用手动将应用程序部署到AppEngine

然而,我花了大约2个小时的时间来构建谷歌云,以便自动构建和部署应用程序。它无法找到python,但我完全不知道它为什么要寻找python

以下是cloubuild.yaml

  - name: maven:3.6.3-adoptopenjdk-11
    entrypoint: mvn
    args: ['--version']

  - name: maven:3.6.3-adoptopenjdk-11
    entrypoint: mvn
    args: ['package']

  - name: 'gcr.io/cloud-builders/gcloud'
    args: ['app', 'deploy', 'app.yaml']

以下是同一根文件夹中的应用程序yaml:

runtime: java11
env: standard
instance_class: F2
automatic_scaling:
  max_instances: 1

以下是输出的错误部分:

Step #2: descriptor:      [/workspace/app.yaml]
Step #2: source:          [/workspace]
Step #2: target project:  [atomic-parity-282520]
Step #2: target service:  [default]
Step #2: target version:  [20200711t113051]
Step #2: target url:      [https://atomic-parity-282520.ew.r.appspot.com]
Step #2: 
Step #2: 
Step #2: Do you want to continue (Y/n)?  
Step #2: Beginning deployment of service [default]...
Step #2: Created .gcloudignore file. See `gcloud topic gcloudignore` for details.
Step #2: ERROR: gcloud crashed (OSError): [Errno 2] No such file or directory: '/workspace/venv/bin/python3'
Step #2: 
Step #2: If you would like to report this issue, please run the following command:
Step #2:   gcloud feedback
Step #2: 
Step #2: To check gcloud for common problems, please run the following command:
Step #2:   gcloud info --run-diagnostics
Finished Step #2
ERROR
ERROR: build step 2 "gcr.io/cloud-builders/gcloud" failed: step exited with non-zero status: 1

Tags: runnameapp应用程序yamltarget部署step
1条回答
网友
1楼 · 发布于 2024-06-16 14:31:01

不久前,我们似乎添加了一些用于db迁移的python脚本。除了脚本之外,还创建了一个venv文件夹

看起来AppEngine会触发它,作为该项目基于Python的线索,即使您设置了一个特定的app.yaml命令来使用Java

删除venv文件夹解决了该问题

相关问题 更多 >