How to collect build info in TFS using the Artifactory NuGet Restore task? - tfs

I'm able to restore packages without collecting build info perfectly fine. However, when I tick the 'collect build info' box, I run into the following error:
[Error] Could not find nupkg file name for:
../[ProjectName]/[ProjectName].csp
Would there be some sort of guide for this?
This is regarding JFrog Artifactory integration with TFS.

This issue occurred since in the project.assets.json you had a reference to type project. We have released a new version of JFrog CLI (1.21.1) that skip dependencies of type project. When using JFrog CLI with the build-name and build-number parameters to create the build info, JFrog CLI tries to scan your project for it's dependencies. When the dependency is written as type project in the project.assets.json, JFrog CLI cannot gather information regarding that dependency (such as sha1, md5 and dependency nupkg file). With the latest release, JFrog CLI does not fail but skips collecting information regarding that dependency.
TFS is using behind the scene JFrog CLI. With the upcoming release of TFS plugin, the latest version of the CLI will be included.
You can, however, update your agent with the latest JFrog CLI version that fixes this issue. You can find more information of how to use your own version of JFrog CLI in our wiki page here

Related

Passing Jenkins credentials to Artifactory without the Artifactory plugin

I have been asked to work on an older shared version of Jenkins. It is so old that installing the Artifactory plug-in is just not possible. The latest version of the plug-in wont load and installing the older version and all its dependencies without an internet connection is just a pain.
In short is there a quick and simple way in which we can pass the credentials to artifactory from Jenkins before Jenkins tries to read or write to the Artifactory repo ?
Edit:
My setup is Jenkins running on RH Linux, building a very simple Maven project with the requirement to output the build artefacts to Artifactory. JFrog CLI is available with my version of Artifactory, however is not running currently on the Linux box.
Option 1 - JFrog CLI
See the documentation of the Maven commands.
JFrog CLI is available on multiple linux architectures (386, amd64, arm64, arm, s390x to date). You can install it as part of your pipeline. Get it here.
Option 2 - Maven Artifactory Plugin
See the documentation of the plugin. You can also learn how to use the plugin from this project example.
You could simply use the Artifactory REST API with curl. Depending on your repository:
curl -u myUser:myP455w0rd! -X PUT "http://localhost:8081/artifactory/my-repository/my/new/artifact/directory/file.txt" -T Desktop/myNewFile.txt
The documentation from JFrog about this is actually pretty good.
You can also add hashes and other parameters this way.
https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API

artifactory jenkins plugin with first class nuget support like maven packages

Looking here I have methods for maven but i cant find nuget:
https://www.jfrog.com/confluence/display/RTF/Working+With+Pipeline+Jobs+in+Jenkins
How do I use the jenkins plugin to upload packages with Nuget Info attached to them?
It sure looks like Nuget is not supported within the plugin (plugin source on github). Nuget CLI reference is probably the next stop and then you'll want to figure out how to update the buildInfo with the package so the two objects can be linked together for management and cleanup. I don't know how to do that step yet but the REST interface. Also, theres a MSBUILD Artifactory plugin that might make this easier.
Publish would look something like this:
nuget push package -Source artifactoryRepoURL -ApiKey ArtifactoryAPIKey
On the Home artifactory page, there's a Set Me Up link for each repo that goes over the details.
The answer is you must use the jfrog cli or the upload() method of the plugin to add build info and do retention. You cannot upload with regular nuget methods.

How to deploy .net artifacts to JFrog artifactory

As JFrog Artifactory provides maven repository which maintains a maven-metadata.xml to get the latest maven artifact.
Is there anything to maintain latest artifacts of .net web applications. It would be good if there's a solution with the trial version.
Thank you
Dotnet Binaries Image
On the PRO version of Artifactory you can also create a Nuget repository and deploy your .net files there. See additional information here:
https://www.jfrog.com/confluence/display/RTF/NuGet+Repositories

Resolve nuget packages from Artifactory Pro using Jenkins Artifactory plugin for .net projects

Mainly used for : C# project, nuget package dependencies, MSBuild build tool (no TFS)
We are evaluating Artifactory Pro eval version, Jenkins for CI & dependency management. Currently, I have setup Jenkins to use the "Generic-Artifactory integration" build environment to resolve/restore nuget packages from Artifactory. I am able to access artifactory from Jenkins and see the various repos.
All I am looking to see is to have the Jenkins CI use the Artifactory plugin to fetch Nuget packages from Artifactory. If the nuget packages are not cached currently in Artifactory, I will go fetch it from Nuget gallery (https://www.nuget.org) and cache them in one of remote repos in Artifactory. Then the subsequent builds can then fetch from this Artifactory cache repo for any nuget dependencies. How do i do this with Jenkins CI, MSbuild tool, Artifactory Pro eval version.
IMO the fastest and easiest way to do that is to use the MsBuild Artifactory plugin.
This plugin is a simple extension for Visual Studio which allows you to add a new project type to your solution.
By doing it you will be able to control how to resolve nuget dependencies from Artifactory and what you want to publish in your repos.
Also I recommend using a single virtual repository for your case and to aggregate in it a local which will be your target for deployment and a remote connected to the official nuget gallery.
Also you can watch this webinar about the MsBuild Artifactory plugin. It is showing how to use it with TFS but the idea is the same for Jenkins as the plugin is simply an extension to the MsBuild process.

Updating jenkins plugin from source

I currently have Build User Vars Plugin 1.1 installed in my Jenkins. Since version 1.1 of the plugin, there has been some important changes to the plugin code, and I want to pick them up. The question is what is the least amount of work to package up the hpi/jpi file that I can push on my Jenkins install that will contain latest changes.
It's fairly easy to build a plugin locally; you can then upload the hpi/jpi file to Jenkins via the Advanced tab in the plugin manager.
See the Jenkins plugin tutorial for detailed steps.

Resources