biraj
biraj

Reputation: 105

How to Build in Jenkings

I have the following understanding about jenkings-

Understanding: We specify our SVN location and the build targets, and jenkings builds the war files.

so, what my assumption: Jenkings gets the latest revision from SVN and builds it.

Question: Is their a way by which I can specify the "SVN revision" to jenkings, to create a build of that revision rather the latest code in SVN ??

Upvotes: 0

Views: 119

Answers (3)

David W.
David W.

Reputation: 107040

The purpose of Continuous Integration tools like Jenkins is to build and test each and every change. That is, as soon as someone checks in a change, Jenkins will try to build it, and run unit tests against that change. In Java, this can usually done in minutes. Errors in the code can be detected and corrected almost as soon as they're made. And, the earlier an error is fixed in the development process, the easier and cheaper it is to fix.

Many people worry that so many builds will take up a lot of space. However, Jenkins usually uses a single working directory where files are compiled, and if you save artifacts from the build, you can specify either by days or number of builds, how many you want to keep. You can also completely delete older builds too.

However, there is good reason to be able to specify a particular revision. We do continuous integration, but only save the last five builds of most of the projects. Sometimes, someone will decide that Build #70 is the build they want to push into production, but the artifacts of that build have been deleted.

We use the Build with Parameters Plugin. I create a parameter for Revision, and then set its default value to HEAD. The URL of the project ends with @${REV} When a commit is done, Jenkins does a regular automatic build with HEAD. However, I can fire off a parameterized build, and select the revision I want to build with.

We also use the Description Setter Plugin, so that builds that aren't from HEAD have a description stating the revision used.

Upvotes: 2

Devesh
Devesh

Reputation: 866

You can use the Subversion Release Manager plugin which displays a list of revisions and allows you to select one to build.

enter image description here

Upvotes: 1

Lux
Lux

Reputation: 106

You can add @33333 to your SVN_URL in the SVN location.

http://svn/repository@revision_number

@See: http://www.supportmyidea.com/2014/02/10/how-to-build-a-specific-svn-revision-in-hudsonjenkins/

Upvotes: 3

Related Questions