Jenkins & Artifactory - jenkins

On a server running ubuntu 12.04 I have installed jenkins 1.532.1 and artifactory 2.6.4.
Both of then are running fine separately. I also have maven 2.
With jenkins, I can build maven java project with sources on subversion.
With maven I can use Artifactory.
The problem is with the artifactory plugin for jenkins.
I added an artifactory server with credentials. Using connection check tell me : "Found Artifactory 2.6.4". It seems to be ok.
But when I create a maven job, in post build actions, I choose Deploy artifacts to artifactory. My server is already selected in the artifactory server but nothing is available in the repositories.
What can I do. Do I have to configure something special in Artifactory ?

I had also this issue, the problem comes from a refresh of Jenkins Plugin.
To deal with that issue, you should:
open your job
add a task for artifactory
save your job
Open again your job
Now you should be able to see your repositories.
Conclusion: You should add/save and reload your job to see your list of repo of artifactory.

I also have this problem, when switching from one artifactory server to another and it looks like a bug for me.
But if I save the settings once without a "non-selectable" repository and access the configuration of the job again, the repositories will be shown.

Ok, so after a very long time I tried again and ... I don't know why but now (I'm quite sure it was not working few months ago) the solution given by aorfevre and user3424040 are working.
I have also upgraded jenkins to 1.565.1 and the artifactory plugin to 2.2.3 and now there is a Refresh Repositories button in the Deploy artifacts to Artifactory task.

For the "Generic-Artifactory Integration" I had to configure Artifactory a bit. I added a group 'deployers' and a user 'deploy' in that group. Also I added a Permission Target for the LOCAL repositories where the group was granted deploy permissions.

Related

Nuget.config file setup in Jenkins (From Jfrog Artifactory)

I'm trying to execute Build action for a dot net core application using Jenkins Pipeline (Cloudbees Jenkins). During the build, when the dotnet restore command is executed, necessary dependency has to be pulled from JFrog antifactory. As of now I have created a local repo, Remote repo and also Virtual repo as suggested by JFrog. What steps have to be taken to make the connection and configuration possible (All the way from Jenkins to Jfrog).
Thanks in Advance.
You should be able to use the Jenkins Artifacttory Plugin. Refer this.

Jenkins / Gitlab Multibranch Pipeline not ignoring projects archived in Gitlab

We're using Jenkins to orchestrate our builds from GitLab using a Multibranch Pipeline strategy. Recently, something changed somewhere, and now Jenkins is no longer ignoring projects archived in GitLab.
We're using the following stack (not all may be relevant to the problem at hand, and certainly not the complete list of plugins, which would take many pages, if there are other items that I can provide, happy to do so):
Jenkins: 2.263.3
Git Plugin 4.5.1
GitLab Enterprise Edition: 13.7.9-ee
GitLab API Plugin for Jenkins: 1.0.6
GitLab Plugin for Jenkins: 1.5.13
GitLab Branch Source Plugin for Jenkins: 1.5.3
We have our projects organized into groups (with no subgroups) in GitLab, and have used a strategy to archive them when they're no longer needed (instead of deleting them). In Jenkins, we have set up a GitLab Group as an "organization folder", which configures itself to autoscan the GitLab group, searching for projects that have a file named "Jenkinsfile" (configured via project recognizer).
I haven't been able to correlate any recent changes to the behavior I'm seeing, but am still searching. Does anyone have any ideas of where to look to fix this, or is this a known issue?
Thanks!

Artifactory server not avaiable on Jenkins

I am new to Jenkins and currently following a tutorial on how to intergrate it with artifactory. I have installed both my artifactory and Jenkins on the same server. I have also installed the artifactory plugin on the Jenkins server.
Unfortunately when i get to the section where i need to select the artifactory server, the drop down menu doesnt show the it.
Below is a screenshot image of what i am referring to.
Jenkins Server Build image
You need to first add an Artifactory server under Manage Jenkins -> Configure System - you'll find the Artifactory section there where you can add servers.
You should probably go over the plugin's own documentation, it outlines the process in detail.

How to trigger a Jenkins build on a new artifact in Artifactory?

Can Artifactory be used as "SCM" or source in Jenkins to trigger the builds on an particular artifact deploy?
Don't see (or miss it) anything similar in the Artifactory Jenkis plugin description (and on Jenkins side)
This could be needed for instance if there is only access to the Artifactory repository and not to the SCM with code the binaries are coming from.
Such functionality looks to be availble for Nexus (via nexus-webhook-plugin). Hard to believe that this feature is missing for Artifactory.
It's maybe not as elegant as a hook, but I believe the URLTrigger Plugin will achieve what you're looking for. Listed in their use cases:
This plugin enables users to check if new artifacts (such as binaries) have been deployed in a repository (managed for example by a repository manager such as Sonatype Nexus, JFrog Artifactory, Apache Archiva and so on).
It allows you to check the last modification date and inspect the contents of the response for changes.
You would have to use a polling interval instead of relying on Artifactory to notify Jenkins via a hook, but in my experience polling is relatively innocuous even with lots of polls at high intervals.
Now you can use Enable Artifactory trigger in a newer version.
Go to Build Triggers and check the Enable Artifactory trigger checkbox.
More Detail on GitHub Support for Artifactory trigger

Publish to Artifactory copied from another project artifacts in Jenkins

So I got few separated jobs in Jenkins. The first one gets the project from a Git repository, builds it and produces artifacts. And another one has to copy certificates from the first job and publish them to Artifactory (tried to make it using the Artifactory plugin). But the thing is that the Artifactory plugin's available only in the Build job, there's nothing like "Generic-Artifactory integration" in second job's configuration.
Does anyone know what are the requirements for making the plugin work in the Publish job?
You can write a small shell script leveraging Artifactory REST API and execute it in your second, non-build job.
I have done a similar thing with maven and a zip file. I have deployed a zip with a build step in maven calling a deploy:deploy-file and setting my Artifactory repository in settings.xml and deploying directly on my artifactory repository.

Resources