code.gitea.io/gitea@v1.22.3/docs/content/usage/packages/vagrant.en-us.md (about) 1 --- 2 date: "2022-08-23T00:00:00+00:00" 3 title: "Vagrant Package Registry" 4 slug: "vagrant" 5 sidebar_position: 120 6 draft: false 7 toc: false 8 menu: 9 sidebar: 10 parent: "packages" 11 name: "Vagrant" 12 sidebar_position: 120 13 identifier: "vagrant" 14 --- 15 16 # Vagrant Package Registry 17 18 Publish [Vagrant](https://www.vagrantup.com/) packages for your user or organization. 19 20 ## Requirements 21 22 To work with the Vagrant package registry, you need [Vagrant](https://www.vagrantup.com/downloads) and a tool to make HTTP requests like `curl`. 23 24 ## Publish a package 25 26 Publish a Vagrant box by performing a HTTP PUT request to the registry: 27 28 ``` 29 PUT https://gitea.example.com/api/packages/{owner}/vagrant/{package_name}/{package_version}/{provider}.box 30 ``` 31 32 | Parameter | Description | 33 | ----------------- | ----------- | 34 | `owner` | The owner of the package. | 35 | `package_name` | The package name. | 36 | `package_version` | The package version, semver compatible. | 37 | `provider` | One of the [supported provider names](https://www.vagrantup.com/docs/providers). | 38 39 Example for uploading a Hyper-V box: 40 41 ```shell 42 curl --user your_username:your_password_or_token \ 43 --upload-file path/to/your/vagrant.box \ 44 https://gitea.example.com/api/packages/testuser/vagrant/test_system/1.0.0/hyperv.box 45 ``` 46 47 If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password. 48 49 You cannot publish a box if a box of the same name, version and provider already exists. You must delete the existing package first. 50 51 The server responds with the following HTTP Status codes. 52 53 | HTTP Status Code | Meaning | 54 | ----------------- | ------- | 55 | `201 Created` | The package has been published. | 56 | `400 Bad Request` | The package is invalid. | 57 | `409 Conflict` | A package with the same combination of parameters exists already. | 58 59 ## Install a package 60 61 To install a box from the package registry, execute the following command: 62 63 ```shell 64 vagrant box add "https://gitea.example.com/api/packages/{owner}/vagrant/{package_name}" 65 ``` 66 67 | Parameter | Description | 68 | -------------- | ----------- | 69 | `owner` | The owner of the package. | 70 | `package_name` | The package name. | 71 72 For example: 73 74 ```shell 75 vagrant box add "https://gitea.example.com/api/packages/testuser/vagrant/test_system" 76 ``` 77 78 This will install the latest version of the package. To add a specific version, use the `--box-version` parameter. 79 If the registry is private you can pass your [personal access token](development/api-usage.md#authentication) in the `VAGRANT_CLOUD_TOKEN` environment variable. 80 81 ## Supported commands 82 83 ``` 84 vagrant box add 85 ```