code.gitea.io/gitea@v1.22.3/docs/content/usage/packages/chef.en-us.md (about)

     1  ---
     2  date: "2023-01-20T00:00:00+00:00"
     3  title: "Chef Package Registry"
     4  slug: "chef"
     5  sidebar_position: 5
     6  draft: false
     7  toc: false
     8  menu:
     9    sidebar:
    10      parent: "packages"
    11      name: "Chef"
    12      sidebar_position: 5
    13      identifier: "chef"
    14  ---
    15  
    16  # Chef Package Registry
    17  
    18  Publish [Chef](https://chef.io/) cookbooks for your user or organization.
    19  
    20  ## Requirements
    21  
    22  To work with the Chef package registry, you have to use [`knife`](https://docs.chef.io/workstation/knife/).
    23  
    24  ## Authentication
    25  
    26  The Chef package registry does not use an username:password authentication but signed requests with a private:public key pair.
    27  Visit the package owner settings page to create the necessary key pair.
    28  Only the public key is stored inside Gitea. if you loose access to the private key you must re-generate the key pair.
    29  [Configure `knife`](https://docs.chef.io/workstation/knife_setup/) to use the downloaded private key with your Gitea username as `client_name`.
    30  
    31  ## Configure the package registry
    32  
    33  To [configure `knife`](https://docs.chef.io/workstation/knife_setup/) to use the Gitea package registry add the url to the `~/.chef/config.rb` file.
    34  
    35  ```
    36  knife[:supermarket_site] = 'https://gitea.example.com/api/packages/{owner}/chef'
    37  ```
    38  
    39  | Parameter | Description |
    40  | --------- | ----------- |
    41  | `owner`   | The owner of the package. |
    42  
    43  ## Publish a package
    44  
    45  To publish a Chef package execute the following command:
    46  
    47  ```shell
    48  knife supermarket share {package_name}
    49  ```
    50  
    51  | Parameter      | Description |
    52  | -------------- | ----------- |
    53  | `package_name` | The package name. |
    54  
    55  You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first.
    56  
    57  ## Install a package
    58  
    59  To install a package from the package registry, execute the following command:
    60  
    61  ```shell
    62  knife supermarket install {package_name}
    63  ```
    64  
    65  Optional you can specify the package version:
    66  
    67  ```shell
    68  knife supermarket install {package_name} {package_version}
    69  ```
    70  
    71  | Parameter         | Description |
    72  | ----------------- | ----------- |
    73  | `package_name`    | The package name. |
    74  | `package_version` | The package version. |
    75  
    76  ## Delete a package
    77  
    78  If you want to remove a package from the registry, execute the following command:
    79  
    80  ```shell
    81  knife supermarket unshare {package_name}
    82  ```
    83  
    84  Optional you can specify the package version:
    85  
    86  ```shell
    87  knife supermarket unshare {package_name}/versions/{package_version}
    88  ```
    89  
    90  | Parameter         | Description |
    91  | ----------------- | ----------- |
    92  | `package_name`    | The package name. |
    93  | `package_version` | The package version. |