Set the release directive for an app (Legacy)¶
本主题介绍如何为应用程序包设置发布指令。
关于发布指令
Release directives determine the version of the app that is available to a consumer when they install or upgrade an app. Release directives are defined in the application package using the ALTER APPLICATION PACKAGE command.
有两种类型的发布指令:
- Custom release directive
Allows a provider to specify the version of an application that specific Snowflake accounts can install. See add a custom release directive for more information.
- Default release directive
Specifies the version and patch that is applicable to all consumers when installing a Snowflake Native App. If a provider creates versions V1 and V2 of an application, setting the default release directive to V2 ensures that when a consumer installs the Snowflake Native App, they install.
See set a default release directive for more information.
如果提供商创建应用程序的 V2 和 V3 版本,则可以将 V2 指定为默认版本,并创建自定义发布指令,以便仅与特定账户共享 V3。在发布应用程序 V3 版本之前,提供商还可以与测试账户共享该版本。
Note
如果同时指定默认发布指令和自定义发布指令,则自定义发布指令始终优先。在上面的示例中,自定义发布指令中指定的使用者账户只能安装应用程序的 V3 版本。
必须先在应用程序包中定义发布指令,然后才能执行以下任务:
- 创建一个将应用程序包作为数据内容的公共列表。
- Install a Snowflake Native App in a consumer account.
设置发布指令所需的权限
要设置发布指令,提供商必须具有应用程序包的 MANAGE RELEASES 权限或所有权。
设置默认发布指令
Use the ALTER APPLICATION PACKAGE command with SET DEFAULT RELEASE DIRECTIVE to set the default release directive as shown in the following example:
To update the default release directive for an application package, run the ALTER APPLICATION PACKAGE command with SET DEFAULT RELEASE DIRECTIVE again, specifying new values for VERSION or PATCH, as appropriate.
设置和更新自定义发布指令
设置自定义发布指令
To add a custom release directive, use the ALTER APPLICATION PACKAGE command with SET RELEASE DIRECTIVE. Use the ACCOUNTS clause to specify the accounts to which this release directive applies. For example:
更新自定义发布指令
To update the version or patch for a custom release directive, use the ALTER APPLICATION PACKAGE command with MODIFY RELEASE DIRECTIVE as shown in the following example:
但是,您不能修改与发布指令关联的账户。要更改与发布指令关联的组织和账户,请执行以下操作:
- Remove the release directive from the application package by running the ALTER APPLICATION PACKAGE command with UNSET RELEASE DIRECTIVE.
- Add the release directive back to the application package by running the ALTER APPLICATION PACKAGE command with SET RELEASE DIRECTIVE and using the ACCOUNTS clause to specify the list of accounts.
Note
更改与发布指令关联的组织和账户时,请在移除旧发布指令后立即添加新发布指令。如果未执行此操作,分配给自定义发布指令的账户的已安装应用程序将恢复为默认发布指令。
移除自定义发布指令
To remove a custom release directive from an application package, use the ALTER APPLICATION PACKAGE command with UNSET RELEASE DIRECTIVE as shown in the following example:
基于发布指令测试应用程序
在开发模式下从应用程序包安装应用程序时,会明确指定版本和补丁。但是,当使用以下命令安装应用程序时:
发布指令确定运行此命令时安装的版本。
查看应用程序包的发布指令
To view the release directives by using SQL, run the SHOW RELEASE DIRECTIVES command as shown in the following example: