Passing Jenkins credentials to Artifactory without the Artifactory plugin - jenkins

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

Related

How to use "docker with pipeline" in Jenkins?

In Jenkins I would like to use docker with pipeline.
That documentation says:
Starting with Pipeline versions 2.5 and higher, Pipeline has built-in
support for interacting with Docker
Our Jenkins is using version 2.305 (2021-08-03) right now. The latest version of jenkins currently is 2.340 (2022-03-22).
How can I find the version of "Pipeline" used at our system?
I found quite a few installed plugins called "Pipeline: ..." with various versions. Which one should be 2.5 in order to make the docker feature available?
Oh, I found it:
https://plugins.jenkins.io/workflow-aggregator/
https://github.com/jenkinsci/workflow-aggregator-plugin/blob/master/CHANGELOG.md
The Plugin was simply not installed at all. (Only many of it's dependencies where installed independently.)

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

There is no AWS Codedeploy Plugin in Jenkins

I use two different Jenkins servers(tomcat jenkins) and i was trying to install a plugin for aws codedeploy.
However, I couldn't find it in the list of a Jenkins but another one has it.
Why the plugin libraries are different? even though i install them in a same way.
Also, How can i add a particular plugin in my Jenkins server?
Thank you.
Why the plugin libraries are different?
The plugin libraries shouldn't be different.
Which way did you search the plugin (jenkins gui, in the web)? Both your servers are on the same Jenkins version?
Also, How can i add a particular plugin in my Jenkins server?
I do it always via the GUI as described here: https://jenkins.io/doc/book/managing/plugins/

How to easily publish non-Maven artifacts from Jenkins to Bintray?

Is there an easy way to publish non-Maven artifacts to a generic repository on Bintray from a Jenkins job? I've been reading through Deploying Maven and Gradle snapshots to OJO but that applies to Maven-compatible artifacts / Maven repositories only.
I'm aware that I could use the Bintray REST API, but that's a bit too low-level for my taste. I'm wondering if there's something for Jenkins like the Artifactory Plugin, but for use with Bintray.
The closest thing I've found so far is a Bintray REST API wrapper like this Perl module, but I don't like that either as I'd need to install the module on all Jenkins nodes then.
For Bintray, there is Bintray Java Client. We are going to release the new version, which supports file upload and signing in the following week or so.

Resources