Amandeep
Amandeep

Reputation: 21

Building a C# Project through SVN using Jenkins - Build succeeds, but where is the output?

What i want is to create installable setup file of a C# project, using SVN as Source Code Manager, and Jenkins as CI tool. I have configured jenkins by entering the SVN repository URL. When i build the project, though the build succeeds, but what i get as output are 2 xml files.

How would i be able to create the installable setup file for this project.

Upvotes: 2

Views: 3494

Answers (1)

Grhm
Grhm

Reputation: 6844

Look at the console output for the job. I suspect your job has built the output you expect but Jenkins is just not presenting it to you. You'll need to alter the Jenkins job to tell it what you are expecting is the output.

Jobs can archive and/or fingerprint the output files. If you alter your Jenkins job, within the configure page, you can choose which files to archive. You need to tell Jenkins where your build output is, e.g. MyProject\bin\Release\*. Once Jenkins know this it will store the files you've identified and present them as the jobs output artifacts.

You can then use those output files to create the installable setup - either manually, or more preferably as another Jenkin job.

You can have another Jenkins job that copys to artifacts from an upstream job (see the CopyArtifact plugin) and then create the installable setup using those and whatever method is approiate for your project and deployment needs.

Alteratively, you could alter the original job, adding a build step to take the built output and create the installer - but again you'd need to tell Jenkins that the *.msi or *.zip etc that it creates is the output artifact.

N.B. Fingerprinting is a method Jenkins uses to store the hash of key files from jobs and track which versions of which files were used where. E.g. if JobA builds a MyProject.dll file, fingerprinting it means you can tell that JobB build123 used the dll from JobA build5.

Generally I archive all the build output (*.dll, *.exe, *.msi, etc) and tell Jenkins to fingerprint all archive artifact.

EDIT:

I only have easy access to a Hudson v1.386 server at the moment (i.e. the version beofre the Hudson/Jenkins split) so this might be subtly different than the Jenkins version.

First, go to relavent job page within Jenkins and click on the Workspace link on the left. This should allow you to see all the files in the workspace, i.e. anything checked out and built after the last build finished. Check that the output files you are expecting are there. If not, you've got a problem with your build steps not generating the output you expected. Fix that first.

Once the output you expect is there, you can tell Jenkins to archive those output files after every build. On the job configuration page, there is a section entitled Post-build Actions. The second option here is "Archive the artifacts", check that box. Then in the "Files to archive" field, put the list of files you deem your output. For example, I've put **/Release/*.msi, **/bin/Release/*, Database/Scripts/*.sql.

I've also checked the "Record fingerprints of files to track usage" option and then "Fingerprint all archived artifacts"

Having done this, hit Save at the bottom and then run a build. Once the build has completed, you should see at the bottom of the console output something like:

Archiving artifacts
Recording fingerprints

The project page should then have a Last Successful Artifacts link, and builds (from this point on) will have a Build Artifacts link.

These links will show a list of the files archived and allow you to download them. I believe that is what you are after.

I'd also suggest lookng at this pother questio for more info: Archive-the-artifacts-in-hudson-jenkins

Upvotes: 1

Related Questions