views:

1142

answers:

2

I have a linux build machine with JBoss, UCM ClearCase and ant installed. I would like to find out how to configure a continuous integration using Hudson and Hudson clearcase plugin. Can I use an existing dynamic view that is already created. Please give me some basic steps. Thank you in advance.

+1  A: 

Yes you can use an existing dynamic view.

The principle is:

  • create the dynamic view on your hudson (master) server
  • indicate in the Hudson Job configuration you want to use an existing dynamic view (you will have to put its root path: /view/yourView)
  • let hudson monitor the files that have evolved since the last run (it will do that by querying the history of files in that dynamic view)

Off course, you will need the ClearCase plugin to be installed first.

Here is an illustration (complete with the mandatory Freehand Circles) of what the configuration of such a Job looks like:

alt text

(Note: M:\myView instead of /view/MyView: that is because I am making this example on my Windows7 laptop)

The documentation of the "Use existing dynamic view" mentions:

If set, Hudson will use an existing dynamic view instead of creating a snapshot view. Hudson will behave differently when working with a dynamic view. It will not create or remove the view so the "Use update" configuration is ignored if this option is enabled. The plugin will update the config spec of the view when needed.

To use this option, the dynamic view has to be created outside Hudson using the common ClearCase tools. A check out will fail if the dynamic view does not exist. The tag of the view should be the same as specified in the "View name" field.

I recommend checking the option Do Not Reset Config Spec to preserve the existing config spec of your view.


workspace] $ cleartool setcs -tag vijaym_SNDBX_INT_View -stream
cleartool: Error: Unable to change configuration specification: Permission denied.
FATAL: UCM ClearCase failed. exit code=1

That means the protection on this view are somehow false:
Could you go on the server in /view/vijaym_SNDBX_INT_View et type

cleartool lsview -l -full -pro -cview?

Possible cause of error:

  • umask != 2 (type 'umask' to check the value, if different from 2, type 'umask 2')
  • owner not vijaym
  • group of the process running Hudson not one of the vob groups (check/set the primary group of the user running that process: 'id -a'

Solution: reset the protection on that view (make sure our path references /usr/atria/etc/utils, where fix_prot is)

cd /  # leave the view
cleartool endview -server vijaym_SNDBX_INT_View # stop completely the view
cleartool umount -all # make sure all vobs are unmounted
# reset protections
fix_prot -force -rec -chown vijaym -chgrp aCorrectGroup -chmod 775 /path/to/vijaym_SNDBX_INT_View.vws
fix_prot -force -root -chown vijaym -chgrp aCorrectGroup /path/to/vijaym_SNDBX_INT_View.vws
#restart the view and mount the vobs
cleartool startview vijaym_SNDBX_INT_View
cleartool mount -all
# check if the protections are ok
cd /view/vijaym_SNDBX_INT_View
cleartool lsview -l -full -pro -cview
VonC
A: 

VonC Thank you for answering my question. I am using UCM ClearCase. Hudson has 3 fields that I populate. View Name, Stream Selector and load rules. I can post my screen capture but I don't see a link to upload the jpg file.

And I get this error. Thank you in advance for all the replies.

Started by user vijaym
[vijaym_SNDBX_INT_View] $ cleartool pwv -root
/view/vijaym_SNDBX_INT_View
[workspace] $ cleartool startview vijaym_SNDBX_INT_View
[workspace] $ cleartool setcs -tag vijaym_SNDBX_INT_View -stream
cleartool: Error: Unable to change configuration specification: Permission denied.
FATAL: UCM ClearCase failed. exit code=1
FATAL: cleartool did not return the expected exit code. Command line="setcs -tag vijaym_SNDBX_INT_View -stream", actual exit code=1
java.io.IOException: cleartool did not return the expected exit code. Command line="setcs -tag vijaym_SNDBX_INT_View -stream", actual exit code=1
 at hudson.plugins.clearcase.HudsonClearToolLauncher.run(HudsonClearToolLauncher.java:100)
 at hudson.plugins.clearcase.ClearToolDynamicUCM.setcs(ClearToolDynamicUCM.java:92)
 at hudson.plugins.clearcase.ClearToolDynamicUCM.syncronizeViewWithStream(ClearToolDynamicUCM.java:57)
 at hudson.plugins.clearcase.action.UcmDynamicCheckoutAction.checkout(UcmDynamicCheckoutAction.java:51)
 at hudson.plugins.clearcase.AbstractClearCaseScm.checkout(AbstractClearCaseScm.java:369)
 at hudson.model.AbstractProject.checkout(AbstractProject.java:830)
 at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:314)
 at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:266)
 at hudson.model.Run.run(Run.java:938)
 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:234)
 at hudson.model.ResourceController.execute(ResourceController.java:93)
 at hudson.model.Executor.run(Executor.java:118)
hudson_newbie
Just added a answer to your `Unable to change configuration specification` message
VonC