Jenkins integration with Artifactory and promotion - jenkins

I am new to Artifactory and would like to know the below
Suppose Jenkins produces the build artifacts( binary or jar) and is deployed to Artifactory repo and at the same time deployed to Dev environment. How do I move the same artifacts to Test environment? Do I need a new Jenkins job? or it can be moved from Artifactory itself ? how
If i build a project 10 times than 10 artifacts will be produces and latest one can be deployed to DEV env. How do I roll back to earlier version?
Can someone explain how does it works jenkins-artifactory
-Thanks

Related

How to do Code Promotion in Artifactory

I am relatively new to Artifactory. We are using gardle artifactory plugin to publish the artifacts & also we are using Jenkins CI to automate builds.
In Artifactory Snapshot we have urls like (dev, stg, perf, prodfix) version & filename(abc-dev.jar).
1.) After dev build, I have to promote abc-dev.jar to stg URL(abc-stg.jar).similarly for rest of environment.
Kindly advise how we can achieve this.
In Jenkins, there's a Pipeline DSL that you can use to promote your builds. See the documentation here:
https://wiki.jenkins-ci.org/display/JENKINS/Artifactory+-+Working+With+the+Pipeline+Jenkins+Plugin

Jenkins Artifactory Integration

I am using the Jenkins Artifactory plugin to publish build artifacts.
I renamed my job on Jenkins but I still see the old name of the job under Artifactory "Builds".
I am new to Artifactory (used Nexus in the past) and I am not sure if there's anything I need to do on Artifactory side to make the necessary name change.
Thanks,
Bella
Artifactory does not discard old builds unless you specifically instruct to do so by deleting those builds so what you're seeing is just the builds from the 'old' job.
Now that you have renamed the job new builds (with the new name) will start showing in the Builds pane once you've started the job.
If you'd like to discard the old builds (from the old jenkins job) you can simply do it from the Builds pane or with the REST api

Jenkins & Artifactory

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.

Deploying a war file from Artifactory to a server

Each commit to our code result in regression tests and deployment of a war file to Artifactory.
We would like to deploy once a day the last successfully tested war.
What would be the best way to do this? We use Jenkins as our CI tool.
If your goal is to save on storage in Artifactory, I'd suggest setup snapshot cleanup instead. You'll always have couple of last sucessfuly tested wars and you won't polute your Artifactory with too many old snapshots.
Create a second job that copies the latest artifact (Copy Artifact Plugin) from your build job and then deploys the artifact. The second job can be scheduled to run once a day.

Retrieving old builds for re-deployment in Jenkins

I have built an automated deployment system using Jenkins, Subversion and ANT on a set of environments. It all works, allowing me to deploy old tagged releases to a set of environments or automatically deploy the latest build using the Subversion Release Manager within Jenkins.
The problem is on the client site, we have to utilise Perforce (which does not currently have a Release Manager plugin within Jenkins [don't really want to write one, but possible]). What is the best way to setup up Jenkins to be able to deploy certain releases to environments? I started looking at Ivy and Artifactory as a possibility.
If anyone has any suggestions, or any guides online, that would be great!
We currently build a WAR file for each Subversion checkin - and make this available with the copy artifact plugin. Redeploy is merely a matter of executing the deploy task for this WAR.

Resources