Creating a Self-Hosted Repo
If you use this service for the first time, you need to create a repository. Self-hosted repos are divided into local repositories and virtual repositories.
Local Repository: An actual physical repository hosted on the server, where you can upload different types of artifacts.
Virtual Repository: Users can configure agent sources in the virtual repository to connect with local third-party repositories. It also offers local repository functions and provides a single entry to make setup easier for customers.
- Click a project card to access the project. (If no project is available, create one.)
- Choose Artifact Self-hosted Repos from the menu bar. Click in the upper left corner of the page.
- The Create Repository page is displayed.
- Configure basic information and click Submit by referring to Table 1.
Table 1 Parameters for configuring repositories Item
Mandatory
Description
Repository Type
Yes
You can choose Local Repository or Virtual Repository.
- A local repository is hosted on the server and is a physical repository that stores artifact data.
- A virtual repository combines local and proxy repositories, offering a single, unified entry for accessing artifacts.
Repository Name
Yes
Enter up to 20 characters: letters, numbers, underscores (_), hyphens (-), and periods (.).
NOTE:After a repository is created, its name cannot be changed.
Package Type
Yes
Local repository supports Maven, npm, Go, PyPI, RPM, Debian, Conan, Docker, CocoaPods, and NuGet artifacts.
Virtual repository supports Maven, npm, Docker, and PyPI artifacts.
Complete the configuration for the selected format by referring to Configuring a Repository.
NOTE:Docker and CocoaPods repositories currently are only available in the AP-Singapore region.
Project
Yes
Choose a project to associate with the newly created repository. After the settings are complete, the project to which the user belongs cannot be changed.
Description
No
Enter up to 200 characters.
- View the list on the left side of the page to find the new repository. Click the repository name to view more details. The repository details are displayed on the General, Resources, and Operation Logs tabs.
- General: displays the repository name, repository type, repository path, relative path, creator, creation time, modifier, modification time, artifact count, and artifact size.
- Resources: collects statistics on artifacts uploaded to the repository by File Counts and Storage Capacity (Byte).
- Operation Logs: displays the operation history of uploading, deleting, and restoring data from the recycle bin in the repository.
Configuring a Repository
The following table describes the configuration items specific to each type of repository. For details, see Table 2.
Package Type |
Item |
Mandatory |
Description |
---|---|---|---|
Maven |
Version Policy |
Yes |
The options are Release and Snapshot. You are advised to select both. If so, two repositories will be generated: Release and Snapshot. If you select one, a Release or Snapshot repository will be generated. |
Include patterns |
No |
Enter the path to be added and click +. During builds, only Maven files whose paths start with the preceding paths can be uploaded to the self-hosted repo. |
|
npm |
Include patterns |
No |
Enter the path to be added and click +. During builds, only npm files whose paths start with the preceding paths can be uploaded to the self-hosted repo. |
Go |
Include patterns |
No |
Enter the path to be added and click +. During builds, only Go files whose paths start with the preceding paths can be uploaded to the self-hosted repo. |
PyPI |
Include patterns |
No |
Enter the path to be added and click +. During builds, ensure that PyPI dependency packages in which the name value in the setup.py file matches the preceding paths. |
RPM |
Include patterns |
No |
Enter the path to be added and click +. During builds, only RPM binary files whose paths start with the preceding paths can be uploaded to the self-hosted repo. |
Conan |
Include patterns |
No |
Enter the path to be added and click +. Only Conan files whose paths start with the preceding paths can be uploaded from a local client to the self-hosted repo. |
Docker |
Include patterns |
No |
Enter the path to be added and click +. Only image files whose paths start with the preceding paths can be pushed to the self-hosted repo. |
CocoaPods |
Include patterns |
No |
Enter the path to be added and click +. During builds, only CocoaPods files whose paths start with the preceding paths can be uploaded to the self-hosted repo. |
Setting Proxy for a Virtual Repository
The new support for custom proxy repositories enables users to create proxies for both open-source and third-party dependency repositories. After files are downloaded from proxy repos, they can be cached to CodeArts Artifact, allowing users to download files from third-party dependencies as fast as from the local repos.
The proxy settings are available for Maven, npm, Docker, and PyPI in self-hosted repos.
In the self-hosted repo, you can add custom mirror sources to the Maven, npm, Docker, and PyPI virtual repositories. To configure a custom mirror source, perform the following procedure:
- Log in to the CodeArts homepage, click the username in the upper right corner of the page, and choose from the drop-down list.
- In the navigation pane, choose Mirror > Mirror.
- Click the Custom Source tab and click Create Proxy in the upper right corner of the page.
- In the displayed dialog box, choose the package type, and enter the proxy name (required), proxy address (required), PyPI index proxy address (required only if the package type is PyPI), proxy username, and proxy password.
- The proxy address must start with https:// or http://. Otherwise, an error message is displayed, indicating that the URL is invalid.
- If you do not set the proxy password, the password set last time is used by default.
- Click OK. The custom proxy source is added.
- You can perform the following operations on a custom proxy source.
Operation
Description
Edit
Click in the Operation column to change the proxy name, proxy username, and proxy password.
Delete
Click in the Operation column to delete the custom proxy source.
If the custom proxy source to be deleted has been associated with a self-hosted repo, remove the proxy source from the Proxy Settings page of that repository and return to this page to delete the proxy source.
Adding Proxies for a Virtual Repository
- A virtual repo has been created. For details, see Creating Repositories.
- Go to the self-hosted repo page. In the left pane, click the name of the target virtual repository.
- Click Proxy Settings in the upper right corner of the page.
- Click Add Proxy and select Open Source or Custom Source.
You can select Third-party Repository or Huawei Local Repository from Custom Source.
- Third-party repository: Set a third-party repository or a repository created by a user as the proxy source.
After selecting a third-party repository, click the Proxy Name drop-down list and select a custom proxy source. For details about how to create a custom proxy source, see Custom Proxy Source.
- Huawei local repository: Set Huawei local repository as the proxy source. Users can only select the local repository of which they are the repository administrator.
You can select a local repository from the Proxy Name drop-down list.
- Third-party repository: Set a third-party repository or a repository created by a user as the proxy source.
- Click OK. The proxy is added.
- Click in the Operation column to change the proxy name, proxy username, and proxy password.
Users cannot edit the proxy source of the Huawei local repository.
Click in the Operation column to delete the proxy.
- Click in the Operation column to change the proxy name, proxy username, and proxy password.
Obtaining Repository Paths
Each time you create a repository, a repository path is generated for it. You will use this path to connect the repository to your local development environment. Perform the following operations to obtain the path.
- Go to the self-hosted repo page. In the left pane, click the name of the target repository.
- The repository path is displayed on the General page. Click to obtain the path.
Deleting a Repository
You can delete repos, and they will be moved to the recycle bin.
- Go to the self-hosted repo page. In the left pane, click the name of the target repository.
- Click Settings on the right of the page to view the basic information about the repository.
- Click Delete on the right of the page. The deleted repo no longer displays in the repo list on the left pane.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot