本文介绍如何通过fun deploy命令或ROS方式将应用部署到云上。
背景信息
优势 | 描述 |
---|---|
具备更完善的资源状态管理机制 | 通过ROS部署应用时,使Funcraft工具能够准确的感知资源的新增、更新、删除以及不变,通过感知这些资源的状态变化,Funcraft可以做出正确的决策,达到预期的行为。 |
具备回滚机制 | 在部署应用的过程中,任何资源的操作失败,都会导致整个资源栈的回滚。通过ROS部署应用,当部署失败时可以回滚到上一个正确的状态,解决部署过程中服务不可用的问题。 |
灵活定义模型 | 通常一个template.yml用来描述一个完整的应用,您看到的template.yml内容,就是您部署到线上应用的最终形态,通过ROS部署可以更加灵活的部署应用。 |
明确部署差异 | 通过ROS部署应用,您可以了解到当前的模板文件是否与线上的文件同步,因此可以快速决策是否直接将本地模板部署到云上。 |
支持更多的云资源 | ROS纳入了更多的云资源的管理,覆盖了使用者的全部使用场景。 |
支持快速创建多套开发环境 | 当需要创建多套开发环境时,无需手动修改资源的唯一名称等标识。 |
功能介绍
fun deploy
的帮助信息。fun deploy -h
Usage: fun deploy [options] [resource]
Deploy a serverless application.
use 'fun deploy' to deploy all resources
use 'fun deploy serviceName' to deploy all functions under a service
use 'fun deploy functionName' to deploy only a function resource
with '--only-config' parameter, will only update resource config without updating the function code
use '--parameter-override', A parameter structures that specify input parameters for your stack template.
If you're updating a stack and you don't specify a parameter, the command uses the stack's existing value.
For new stacks, you must specify parameters that don't have a default value. Syntax: parameterkey=parametervalue.
Options:
-t, --template [template] The path of fun template file.
-c, --only-config Update only configuration flags
-p, --parameter-override <parameter> A parameter structures that specify input parameters for your stack template.
-y, --assume-yes Automatic yes to prompts. Assume "yes" as answer to all prompts and run non-interactively.
--use-ros Deploy resources using ROS
--use-nas Automatically upload local resources to NAS.
--stack-name <stackName> The name of the ROS stack
--push-registry <pushRegistry> Modify the image upload path
-h, --help display help for command
fun deploy命令部署
ROS方式部署