我正在一个小组项目中,我们希望将后端部署到Google Cloud。后端使用Java11,Gradle和Spring-Boot创建,并通过Travis通过GitHub部署到Google Cloud。
后端使用可以在localhost上正常运行./gradlew bootrun,但是当尝试将其部署到Google Cloud时,出现以下错误:
ERROR: (gcloud.app.deploy) Your application does not satisfy all of the requirements for a runtime of type [java11]. Please correct the errors and try again.
我们通过以下过程重新创建了此错误,从等式中删除了GitHub和Travis:
使用以下设置在https://start.spring.io/创建一个新的Spring-Boot项目:
创建完成后,我们添加了文件app.yaml和client_secret.json。
该client_secret.json文件包含有关gcloud上的测试客户端的信息,并具有很多权限。
app.yaml:
runtime: java11
env: flex
service: default
handlers:
- url: /.*
script: this field is required, but ignored
Run Code Online (Sandbox Code Playgroud)
双方app.yaml并client_secret.json存储在同一个地方build.gradle,并settings.gradle有。
然后,从终端(我们在VScode中使用了那个)开始运行gcloud app …