This document describes how to store NuGet artifacts in CODING-AR for centralized artifact management and version control. The following sections introduce how to create an artifact repository and NuGet package, pull and push artifacts, and configure proxies.
Note:Before you begin:
- Install NuGet.
- Create an artifact repository (see Basic Operations).
- Select NuGet as the repository type.
Visit the NuGet website to and download and install NuGet.
You can skip this section if you are familiar with NuGet artifacts.
mkdir nuget-demo && cd nuget-demo
.nuspec
package.nuget spec [Artifact Name]
nuget pack <artifact name="">.nuspec
Visit the NuGet website, search for a NuGet artifact, and download it or pull it via the command line.
Pull an artifact via the command line:
nuget install [Artifact Name] -OutputDirectory packages
Authentication information must be configured before you can pull artifacts from or push artifacts to CODING-AR. The following example uses automatic configuration.
Click Generate configuration from access token and enter your password to obtain the configuration command. Then, copy and run the command in the directory where the NuGet artifact is stored. During this process, permission control is implemented with the personal access token.
Replace the variables and run the command push an artifact.
nuget push -ApiKey api -Source [Repository name in the push guide] [Local artifact name].nupkg
Replace the variables and run the command pull an artifact.
nuget install -Source [Repository name in the pull guide] -Version [Artifact Version] [Artifact Name]
If you try to pull an artifact that does not exist in the CODING private repository, the system will try to pull from the configured proxy. You can add a third-party artifact source to obtain artifacts from the specific repository. Without the need for configuration, CODING will retrieve artifacts in sequence from top to bottom.
Run the following command to pull an artifact:
nuget install -Source [Repository Name] -Version [Artifact Version] [Artifact Name]
NoteIf CODING-AR does not automatically store NuGet artifacts pulled from the proxy, check:
- Whether you have the permission to push artifacts to this repository.
- Whether the artifacts already exist in your local cache.
Was this page helpful?