1
1
mirror of https://github.com/go-gitea/gitea synced 2024-06-25 04:35:48 +00:00
gitea/docs/content/usage/packages/chef.zh-cn.md
John Olheiser bd4c7ce578
Docusaurus-ify (#26051)
This PR cleans up the docs in a way to make them simpler to ingest by
our [docs repo](https://gitea.com/gitea/gitea-docusaurus).

1. It includes all of the sed invocations our ingestion did, removing
the need to do it at build time.
2. It replaces the shortcode variable replacement method with
`@variable@` style, simply for easier sed invocations when required.
3. It removes unused files and moves the docs up a level as cleanup.

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-07-26 04:53:13 +00:00

2.4 KiB
Raw Blame History

date title slug sidebar_position draft toc menu
2023-01-20T00:00:00+00:00 Chef 软件包注册表 chef 5 false false
sidebar
parent name sidebar_position identifier
packages Chef 5 chef

Chef Package Registry

为您的用户或组织发布 Chef cookbooks。

要求

要使用 Chef 软件包注册表,您需要使用 knife.

认证

Chef 软件包注册表不使用用户名和密码进行身份验证,而是使用私钥和公钥对请求进行签名。 请访问软件包所有者设置页面以创建必要的密钥对。 只有公钥存储在Gitea中。如果您丢失了私钥的访问权限您必须重新生成密钥对。 配置 knife,使用下载的私钥,并将 Gitea 用户名设置为 client_name

配置软件包注册表

要将 knife 配置为使用 Gitea 软件包注册表,请将 URL 添加到 ~/.chef/config.rb 文件中。

knife[:supermarket_site] = 'https://gitea.example.com/api/packages/{owner}/chef'
参数 描述
owner 软件包的所有者

发布软件包

若要发布 Chef 软件包,请执行以下命令:

knife supermarket share {package_name}
参数 描述
package_name 软件包名称

如果已经存在同名和版本的软件包,则无法发布新的软件包。您必须先删除现有的软件包。

安装软件包

要从软件包注册表中安装软件包,请执行以下命令:

knife supermarket install {package_name}

您可以指定软件包的版本,这是可选的:

knife supermarket install {package_name} {package_version}
参数 描述
package_name 软件包名称
package_version 软件包版本

删除软件包

如果您想要从注册表中删除软件包,请执行以下命令:

knife supermarket unshare {package_name}

可选地,您可以指定软件包的版本:

knife supermarket unshare {package_name}/versions/{package_version}
参数 描述
package_name 软件包名称
package_version 软件包版本