2017-02-06 51 views
7

我試圖部署app.yaml文件來appengine靈活。AppEngine部署錯誤(app.yaml)

這裏是我的app.yaml文件

runtime: java 
env: flex 
manual_scaling: 
    instances: 1 

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

runtime_config: # Optional 
    jdk: openjdk8 
    server: jetty9 

resources: 
    cpu: 0.5 
    memory_gb: 0.18 
    disk_size_gb: 10 

我試圖用這個命令部署:

gcloud應用程序部署的app.yaml --verbosity =調試

這是我得到的錯誤:

DEBUG: No staging command found for runtime [java] and environment [FLEX]. 
WARNING: Deployment of App Engine Flexible Environment apps is currently in Beta 
Building and pushing image for service [my-service] 
DEBUG: Could not call git with args ('config', '--get-regexp', 'remote\\.(.*)\\.url'): [Error 2] The system cannot find the file specified 
INFO: Not checking for [Custom] because runtime is [java] 
INFO: Not checking for [Go] because runtime is [java] 
INFO: Not checking for [Ruby] because runtime is [java] 
INFO: Not checking for [Node.js] because runtime is [java] 
INFO: Checking for Java. 
INFO: Not checking for [Python Compat] because runtime is [java] 
INFO: Not checking for [Python] because runtime is [java] 
INFO: Not checking for [PHP] because runtime is [java] 
DEBUG: (gcloud.app.deploy) Your application does not satisfy all of the requirements for a runtime of type [java]. Please correct the errors and try again. 
Traceback (most recent call last): 
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\calliope\cli.py", line 742, in Execute 
    resources = args.calliope_command.Run(cli=self, args=args) 
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\calliope\backend.py", line 739, in Run 
    resources = command_instance.Run(args) 
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\surface\app\deploy.py", line 59, in Run 
    return deploy_util.RunDeploy(args) 
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\command_lib\app\deploy_util.py", line 413, in RunDeploy 
    all_services) 
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\command_lib\app\deploy_util.py", line 241, in Deploy 
    new_version, service, source_dir, image, code_bucket_ref) 
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\command_lib\app\deploy_util.py", line 176, in _PossiblyBuildAndPush 
    code_bucket_ref, self.deploy_options.use_runtime_builders) 
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\api_lib\app\deploy_command_util.py", line 206, in BuildAndPushDockerImage 
    gen_files.update(_GetDockerfiles(service, source_dir)) 
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\api_lib\app\deploy_command_util.py", line 139, in _GetDockerfiles 
    'again.'.format(info.runtime)) 
UnsatisfiedRequirementsError: Your application does not satisfy all of the requirements for a runtime of type [java]. Please correct the errors and try again. 
ERROR: (gcloud.app.deploy) Your application does not satisfy all of the requirements for a runtime of type [java]. Please correct the errors and try again. 

所以它最終沒有部署app.yaml。 但是,如果我運行此命令:

gcloud應用部署cron.yaml

它會工作得很好。

+0

首先,確保你是最新的:'gcloud組件更新'。 – GAEfan

回答

7

是的,這是一個現在的差距:/您實際上不能通過gcloud app deploy將Java應用程序部署到App Engine flexible。您需要使用MavenGradle插件。

對不起,麻煩!

+2

有沒有GitHub的問題或沒有跟蹤這個差距?我很想添加一個「+1」或「:(」)表情符號。 –

+0

@ChrisSmith,我同意。我失去了很多時間,發現只有Maven或Gradle纔是上傳到AppEngine flex的唯一方法。 gcloud app deploy似乎是一個明顯的選擇,我會一次又一次地閱讀文檔,Google很清楚,只有Maven和Gradle能夠工作。讓我困惑的是,Maven基本上在運行過程中運行gcloud應用程序部署,但運行它沒有Maven產生不好的結果。 –