`gcloud app deploy` 与 `appcfg.py` [英] `gcloud app deploy` vs. `appcfg.py`

查看:21
本文介绍了`gcloud app deploy` 与 `appcfg.py`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直是 appcfg.py 的长期用户,我什至在它之上构建了一些 bash 脚本.

  1. 我们应该切换到 gcloud app deploy 吗?appcfg.py 会被弃用吗?如果是,时间表是什么?

  2. 为什么 yaml 文件的向后兼容性没有宽限期?切换到 gcloud app deploy 我得到:

<块引用>

[application] 字段在文件 [.../app.yaml] 中指定.这gcloud 不使用该字段,必须将其删除.项目名称应而是由 gcloud config set project MY_PROJECT 指定或者通过在单个命令执行时设置 --project 标志.

<块引用>

错误:[版本] 字段在文件 [.../app.yaml] 中指定.这gcloud 不使用该字段,必须将其删除.版本是默认自动生成,但也可以手动指定通过在单个命令执行时设置 --version 标志.

我这么说是因为这可以通过模块/服务字段实现:

<块引用>

警告:应用程序 .yaml 文件中的module"参数是已弃用.请改用服务"参数.

  1. 如何使用 gcloud app deploy<上传 queue.yamldispatch.yamlcron.yaml/strong>?

  2. 部署应用的两种方式有什么区别?

    我对警告和注意事项感兴趣需要注意的事项,例如:

<块引用>

FLAGS --promote 提升部署版本以接收所有流量.默认为真.

这意味着使用 gcloud app deploy 将部署该应用程序,并将新版本设置为活动版本...这与 appcfg.py 完全相反strong> 所做的事情,您必须调用 set_default_version 才能将版本标记为活动版本.

这提出了我的最后一个问题:如果我选择不使用任何一个来激活它

<块引用>

$ gcloud config set app/promote_by_default false

<块引用>

使用 --no-promote 禁用.

我是否必须重新部署默认值才能使其处于活动状态?

解决方案

长话短说:

  1. gcloud app deploy 将成为未来部署的首选路径,目前受支持.在我们宣布弃用后,您将有大约一年的时间进行过渡.
  2. 在弃用 appcfg.py 之前,我们将拥有包含所有更改的完整迁移指南.我们不希望完全向后兼容,因为我们正在抓住这个机会用旧工具修复一些缺陷.
  3. 您可以运行 gcloud app deploy cron.yaml 等来部署备用 YAML 文件.
  4. 同样,我们计划在强迫您使用新工具之前编写迁移指南.

所以我认为在我们正式弃用 appcfg 工具之前,您可以继续使用这个工具——gcloud 应用程序 真的适合那些想要最新最闪亮的应用的勇敢探索者现在.

I've been a long time user of appcfg.py and I even build some bash scripts on top of it.

  1. Should we switch to gcloud app deploy? Will appcfg.py be deprecated? If yes what is the timeline?

  2. Why isn't there a grace period for backward compatibility of the yaml file? Switching to gcloud app deploy I get:

The [application] field is specified in file [.../app.yaml]. This field is not used by gcloud and must be removed. Project name should instead be specified either by gcloud config set project MY_PROJECT or by setting the --project flag on individual command executions.

and

ERROR: The [version] field is specified in file [.../app.yaml]. This field is not used by gcloud and must be removed. Versions are generated automatically by default but can also be manually specified by setting the --version flag on individual command executions.

I am saying this as this was possible w/ the module/service field:

WARNING: The "module" parameter in application .yaml files is deprecated. Please use the "service" parameter instead.

  1. How do you upload queue.yaml, dispatch.yaml and cron.yaml with gcloud app deploy?

  2. What are the differences between the 2 ways of deploying an app?

    I'm interested in caveats & things to watch for like:

FLAGS --promote Promote the deployed version to receive all traffic. True by default.

That means w/ gcloud app deploy the app will be deployed and the new version will be set as the active one... this is exactly the reverse way appcfg.py did things as there you would have to call set_default_version to mark a version as active.

This raises my last question: if I opt to NOT make it active by using either

$ gcloud config set app/promote_by_default false

or

Use --no-promote to disable.

will I have to redeploy w/ default value so I can make it active?

解决方案

Long story short:

  1. gcloud app deploy is going to be the preferred path for deployments going forward, and is currently supported. You'll have about a year after we declare deprecation to transition.
  2. Before we deprecate appcfg.py, we'll have a full migration guide with all of the changes. We don't want full backwards compatibility, because we're seizing this chance to fix some warts with the old tooling.
  3. You can run gcloud app deploy cron.yaml and so on to deploy the alternate YAML files.
  4. Again, we're planning on writing a migration guide before we want to force you over to the new tooling.

So I think you can punt on this until we've officially deprecated the appcfg tooling–gcloud app is really meant for brave explorers who want the newest and shiniest for now.

这篇关于`gcloud app deploy` 与 `appcfg.py`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆