自最近 appcfg 弃用以来出现问题。我的项目是用 ant 在到 GCP 的詹金斯管道中构建的 java8。
[exec] 95% Application deployment failed. Message: Deployments using appcfg are no longer supported. See https://cloud.google.com/appengine/docs/deprecations
在 GCP 中,我有 3 个项目,开发、测试和直播。我使用参数构建以通过 jenkins 匹配项目。例如,使用测试构建通过了部署测试的参数。
来自 ant build.xml 的片段:
<target name="deploy-test" depends="build, setup-for-appengine, setup-for-test, deploy"></target>
<target name="deploy-live" depends="build, setup-for-appengine, setup-for-live, deploy"</target>
<target name="setup-for-test" description="Configuration for test">
(Some config stuff e.g. replacing app id and version in the appengine-web.xml)
</target>
<target name="deploy" description="Upload to App Engine.">
<exec executable="${FILE PATH TO appcfg.sh}" failonerror="true">
<arg line="update '${.ENV FILE PATH}/war'" />
</exec>
</target>
我已经从 App Engine SDK 更新到 Cloud SDK 并迁移到 gcloud CLI。我在 build.xml 中的可执行文件现在是:
<target name="deploy" description="Upload to App Engine.">
<exec executable="${FILE PATH TO gcloud executable}" failonerror="true">
<arg line="app deploy '${.ENV FILE PATH}/war'" />
</exec>
</target>
此部署将通过 jenkins 成功运行,但这会导致 500 错误并针对 dev 而不是 test。唯一改变的是从 App Engine SDK 到 Cloud SDK 并迁移到 gcloud 命令的文件路径。
[exec] descriptor: [filepath/appengine-web.xml]
[exec] source: [filepath/war]
[exec] target project: [dev]
[exec] target service: [default]
[exec] target version: [version no.]
[exec] target url: [https://dev.appspot.com]
任何方向将不胜感激。提前致谢