1

I am looking for a plugin or extension, which can be used to create clearcase dynamic view using Jenkins. The existing clearcase plugin gives this functionality for snapshot view only. This post also gives an idea of using script for creating CC view.

Has somebody done/doing similar work? That will be nice if I can get some ideas how to proceed further. It should be for base clearcase, not for UCM.

Community
  • 1
  • 1
Digeek
  • 859
  • 2
  • 10
  • 20

2 Answers2

2

Create, maybe not.

But the ClearCase plugin allows for using an existing dynamic view.

https://wiki.jenkins-ci.org/download/attachments/2916537/base_dynamic_config.png?version=1&modificationDate=1252688398000

Optionally, you can use an existing dynamic view, rather than a new snapshot view. To do so, check "Use dynamic view" under the advanced options.

View root

Required for dynamic view use - this is the directory or drive under which dynamic views live. On Unix, this is generally "/view", while on Windows, it's generally "M:\".

Do Not Reset Config Spec

If selected, the dynamic view's config spec won't be changed, regardless of whether it matches the config spec specified in the job configuration.


The plugin itself creates snapshot view in hudson.plugins.clearcase.ClearToolExec class.
You can use a similar code for dynamic view.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Yes it does only for existing views. But the idea is that we don't want to use CC gui separately and selection of config spec and baselines should be done within Jenkin (VoB may be constant in this case), finally creating a dynamic view. But if we look over CC gui for creating a view, selection between dynamic and snapshot view only differs in terms of "Data Location" (there may be much difference but I don't know much about them) and rest of parameters remain same; vob, baseline, view name etc. will it work by making changes in the snapshot to implement it for dynamic view? – Digeek Sep 06 '13 at 11:59
  • 1
    @Afzal you don't have to use CC gui for creating a dynamic view: you can do it in a script as a pre-step of your job: see http://stackoverflow.com/a/8704153/6309 or http://stackoverflow.com/a/9357692/6309. – VonC Sep 06 '13 at 12:14
  • I mean we will not do it through command line as well. The idea is that to make it easy by using jenkins only; by giving info about vob (which is constant) and path to config specs. Do you have any idea where creation of snapshot view implementation is done in clearcase source code? – Digeek Sep 06 '13 at 12:22
  • @Afzal if you are not using the CC Gui or the cleartool CLI, what do you want to use? Nobody but IBM has access to the "ClearCase source code". – VonC Sep 06 '13 at 12:27
  • We need gui in Jenkins which will have VoB and config spec location, based on this information, it should give a drop-down menu with available baselines, then a specified view name and finally it should create a view (as done in CC gui). Plugin should use required commands for creating a view but these commands will be embedded inside the source code. I was talking about source code for Jenkins CC plugin because it says if "use dynamic view" check-box is not selected, then it will create snapshot view. Where in source code, snapshot view creation is implemented (in Jenkins CC plugin)? – Digeek Sep 06 '13 at 12:45
  • @Afzal quick comment, what are you calling "baseline"? Base ClearCase has only labels. UCM ClearCase has baseline on UCM component. – VonC Sep 06 '13 at 12:47
  • 1
    @Afzal " Where in source code, snapshot view creation is implemented (in Jenkins CC plugin)?": It is in the [`hudson.plugins.clearcase.ClearToolExec`](https://github.com/jenkinsci/clearcase-plugin/blob/master/src/main/java/hudson/plugins/clearcase/ClearToolExec.java#L507-L535) class. – VonC Sep 06 '13 at 12:54
  • @Afzal I have added that link in the answer, for you to select. – VonC Sep 06 '13 at 13:13
2

This question is a bit old now so you have probably moved on and found a solution, but this might be useful for someone else looking for the answer. We use Jenkins on Windows and create dynamic views on the fly, using a CreateView.bat script:

echo Usage: CreateView.bat CLEARCASE_ROOT(e.g. M:) VIEW_NAME REGION [CONFIG_SPEC(Latest)] [ENABLE_WINKIN(true)]
SET CLEARCASE_ROOT=%1
SET VIEW_NAME=%2
SET REGION=%3
SET CONFIG_SPEC=Latest
if NOT "%4"=="" SET CONFIG_SPEC=%4
SET WINKIN=n
if /I "%5"=="true" SET WINKIN=

echo Creating new view at %CLEARCASE_ROOT%\%VIEW_NAME% on %COMPUTERNAME% with Config Spec %CONFIG_SPEC% in Region %REGION%
if "%WINKIN%"=="n" (echo WINKIN IS DISABLED ON THIS VIEW) else (echo WINKIN IS ENABLED ON THIS VIEW)

cleartool mkview -tag %VIEW_NAME% -region %REGION% -%WINKIN%shareable_dos \\%COMPUTERNAME%\views\%VIEW_NAME%.vws
cd /d %CLEARCASE_ROOT%\%VIEW_NAME%
if /I NOT "%CONFIG_SPEC%"=="latest" cleartool setcs %CLEARCASE_ROOT%\%VIEW_NAME%\CMAdminVOB\config-specs\%CONFIG_SPEC%
cleartool catcs

We typically call this with something like:

call D:\BuildTools\ClearCase\CreateView.bat M: my_view_name vpd_my_region my_config_spec true

You can probably adapt the above to suit your needs

stuartjsmith
  • 431
  • 4
  • 8