How to deploy .net artifacts to JFrog artifactory - jenkins

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

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

Nexus packages deployment using Jenkins

I am trying to automate build and deployment of .Net windows service and SQL server scripts using Jenkins.
For .Net windows service, I am able to use MSBuild to create release exe/dlls. I have zipped the release folder and uploaded to Nexus.
For SQL server scripts, I have started using SSDT and able to create .dacpac file. I am also able to generate deployment script for a specific server using the .dacpac file. I have uploaded the .dacpac file to Nexus.
I am not sure what the best practices to deploy .Net artifacts from Nexus. I have the following questions:
How do I deploy .net Nexus packages? (do I unzip them and use
InstallUtil to install the service?)
How do I deploy sql .dacpac Nexus package? (do I unzip the
package and use SQLPackage to generate a script for the target
database server?)
Are there any better ways to deploy .Net Nexus packages?
Use NuGet packages and upload NuGet packages to nexus.
create a NuGet package using nuget pack command. You can do
this part of your msbuild
Push the above created NuGet package to
Nexus using nuget push command.
Here is the link about how to setup .Net Package repositories in Nexus
https://help.sonatype.com/repomanager2/.net-package-repositories-with-nuget

How to set up a private Docker repository with Artifactory OSS?

I tried to set up a private docker repository using Artifactory OSS (open source version) but could not find how to do it. The online documentation is about using the licensed Artifactory product as a docker repository.
Does anyone know how to set it up in Artifactory OSS?
I installed and started Artifactory OSS, but could not find docker package information. The Package View feature is disabled in OSS version.
According to the Artifactory Comparison Matrix, Artifactory OSS only supports Maven, Gradle and Ivy.
To use the Artifactory Docker package management you have to purchase Artifactory Pro, Artifactory Cloud or Artifactory Enterprise. Another solution is to use Nexus Repository OSS which include this feature in the open source version.

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

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

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.

Resources