How to configure project in Hudson/Jenkins to report to Jira - hudson

I have installed and configured this plugin:
http://wiki.hudson-ci.org/display/HUDSON/JIRA+Plugin
In Jira I have turned ON option "accept api calls"
in Jira logs i can see that Hudson established connection
but nothing else happens, ive got test builds and they're failing but hudson doesnt report anything to jira
how to name job? how to name tests? do i need jiraID?
how to create issue that works with hudson?
how to actually tie hudson job with jira issue?

I recommend you to use this plugin: Marvelution JIRA Hudson Integration. With it I hope yo could solve your problem.
You have to install 2 different parts of the plugin, one in JIRA and another one in Jenkins (it enables a new API to allow JIRA to connect with Jenkins).
Then, you have to go to JIRA Administration, Hudson, Servers, Add Server, configure there your Jenkins server.
After that, go to Administration, Hudson, Associations, Add a Hudson Association and link your project in JIRA with your Jenkins task (a list of tasks will be shown).
Finally, you only have to go to your JIRA project's page and you'll see a Hudson tab in which you can see the integration that you need.

Jenkins cannot resolve Jira issues. It only can post comments.
Also Jenkins does not post comments in Jira issues named as tests or jobs or anything
in scans comments in commit to svn and if there is a Jira id then after build it posts comment.
This is too poor and basic functionality for me so I gave up.
I recently found this plugin:
https://wiki.jenkins-ci.org/display/JENKINS/Jira+Issue+Updater+Plugin
but I'm in the middle of a project and dont want do test it now

If you want to create issues in Jira from e.g. failed tests in Jenkins, then the JiraTestResultReporter plugin will help you. See this link.

I am currently attempting to integrate Jenkins (version 1.53+) with JIRA (v5.2) to have the i) create jira issue and ii) update jira issue capabilities. My source control is SVN and my user is configured with CROWD
Currently, I am able to only update a JIRA issue from a post-build. The key is to have the latest SVN commit message begin with '-' as the format (i.e. 'PROJECT-3' denotes issue number 3 for jira project key = PROJECT)
See the overall plugin and configuration process at this link: http://blog.dominikschadow.de/?p=313
output of jenkins updates the JIRA issue (referenced in the svn commit message as I indicated) with:i) STATUS ii)jenkins job output link iii) svn commit message and file(s) changes / removed.

Related

Force Jenkins Subversion plugin to use HEAD revision

I was using Hudson for doing my project builds and now planning to migrate to Jenkins.
The build server time is not in sync with the developer machines, and hence svn update does not work correctly. In Hudson, I was able to set the revision policy to HEAD, whereas its missing in Jenkins.
I searched a bit and saw that a Jira is created for this issue, but did not find a working solution for the problem.
I tried to manually install the Hudson subversion plugin in Jenkins, and the Revision policy option came up, but for some reason it caused an exception while setting the svn authentication info.
If anyone knows a solution to make this change in Jenkins, kindly reply.
Figured out. Append all SVN urls with #HEAD and svn update will happen from HEAD!
The plugin doesn't offer such feature but you might find useful this jira issue. There is a patch in the comments for that purpose. See Issue 1241.

How do I choose an artifact from Nexus in a Hudson / Jenkins job?

I have a job in Hudson server A which builds an artifact and deploys it to Nexus. I have another job in a completely separate Hudson server B which needs to download the artifact and deploy it. This job is normally run manually, and the person running it needs to indicate which version of the artifact to deploy - they may not always want to deploy the latest version (e.g. to roll back to a previous known good version).
Currently, I achieve this by using a parameterized build, and require the user to pass in the artifact version number; the job then uses the Execute shell build step to run wget on a URL constructed using the parameter. This is error prone.
Ideally I'd like a plugin that lets the user browse the artifact versions in the Nexus repository and pick and choose the one to deploy, but I'm open to other suggestions. A plugin that also handles the download would be nice, but I can live without it as long as I can still get a string that I can use in shell commands.
I've looked through the available Hudson & Jenkins plugins around Maven style artifact repositories, but they all seem more concerned with pushing artifacts into repos rather than getting them back down.
I'm using Hudson's "Copy Artifact" in other jobs, to get artifacts from other Hudson jobs on the same server, but this doesn't work across different Hudson servers, which is why I've turned to Nexus (which we're already using anyway).
Does anyone have any suggestions?
I recommend using rundeck to execute your deployments.
There is a rundeck plugin for Nexus that enables rundeck to display a pull down menu of available versions in Nexus.
There is a rundeck plugin for Jenkins that can be used to invoke deployments using rundeck and kick-off post deployment jobs (like integration testing) inn Jenkins.

Configuring the Atlassian JIRA plugin to work with Jenkins CI system

I am trying to configure the JIRA plugin with Jenkins but I am receiving the error
"This is a valid URL but it doesn't look like JIRA".
I am trying to connect to my company installation of JIRA studio which is http://[company].jira.com and I know this URL is correct as I have several projects using it successfully. Is there some setting I should enable in JIRA studio for this to work?
I had a similar issue and fixed it by setting our JIRA studio Title to "Atlassian JIRA".
You can change it by going to admin->general->account->account name->(change)
The plugin looks for one (or both) of those words, I forget which.
You might also have to enable "Accept Remote API Calls" in admin->issues->global settings->general configuration->options
Hope that works for you.

Problem with Hudson-JIRA-Perforce integration

I'm looking at using the Hudson JIRA plugin to post a JIRA comment on each build. The SCM I'm using is perforce which is already linked to the JIRA tasks using perforce jobs. I can see that the JIRA story (e.g. PROJ-001) is visible through the perforce plugin when clicking on the changelist number in the build reports.
I'm having problems getting the Hudson JIRA plugin to work as it appears to expect the JIRA story in the change text rather than using the perforce job reference.
Note, manually adding the JIRA story into the changetext for every commit is not an option, but I was wondering whether any had any ideas short of extending the JIRA plugin itself.
Have you tried any of these???
http://wiki.hudson-ci.org/display/HUDSON/JIRA+Plugin
https://plugins.atlassian.com/plugin/details/11858
Why don't you use Marvelution JIRA Hudson Integration? I tried it and it worked perfect.

Execute command in Hudson as Post-build Actions

I am new in Hudson.
I would like to execute a 'sourcecodeanalyzer' command in Hudson as Post-build Actions to generate an html report. Please let me know is this at all possible, if yes let me know the Hudson configuration steps to execute the command.
Your earliest response in this regard will be extremely helpful.
Thanks in advance.
Yes, it is almost certainly possible.
You will need to configure the Hudson project to have either a post-build action or a build step that runs your source code analyzer.
You've not stated in your question precisely which analyzer - it may be that Hudson already has a plug-in installed for it, in which case it may be listed on the Config page for the project at the bottom under Post-build Actions.
If not, next check to see if there's a plug-in available for the analyzer that hasn't been installed. From the main Hudson page select Manage Hudson, then Manage Plugins, and choose the Available tab. If there is a plug-in available it's definitely a good idea to use it as they are generally very well integrated with Hudson itself.
As a last resort you'll have to configure a build step to run the analyzer. Configure the project, then choose "Add build step". The drop-down that appears depends on your environment (Windows or Linux) but should include the ability to run a shell command or batch file. You can configure your analyzer there.
(If you're building Windows Visual Studio applications, a more flexible way that I've used is to use the MSBuild plug-in for builds, and have an MSBuild script that builds the application and then runs analysis tools. This can automate pretty much everything: mine builds the application, builds an acceptance test database, runs the acceptance tests and copies the result HTML to a page linked from the project.)
You could create a new job with a "Execute Shell" build step. Type in the command you wish to run in the text box. Then all you have to do is trigger this job by selecting:
"Build after other projects are built"
And select the trigger job from the list.
Hope this helps!
As a follow up to Jeremy's post. If you don't see the ability to add post build steps, you might work with maven jobs. In that case you need the Hudson M2 Extra Steps Plugin. This will give you pre and post build steps.
I use the 'Post build task' plugin to delete some resources after a build. You could call any shell script or command lines. If you want you could make the call depends on some logging output.
there is one best way to solve this:
Upgrade to Fortify SCA 2.6.x (as of writing, latest version is 2.6.5).
Download the Fortify Maven Plugin version 2.6 from https://customerportal.fortify.com and install it into your Hudson server's Maven repository.
Update your project's pom to carry out the Fortify scan. There is an example provided with the Maven plugin.
Currently , I am experiment with sonar plug in. It looks great check the details here
http://sonar.codehaus.org/a-new-hudson-plugin-for-a-closer-integration-with-sonar/
http://wiki.hudson-ci.org/display/HUDSON/Sonar+plugin