KBEC-00177 - Running in the context of a ClearCase dynamic view within CloudBees CD (CloudBees Flow) steps

Article ID:360032830472
1 minute readKnowledge base

Description

(Linux/Unix only)
In order to access files using ClearCase dynamic views, a view context must be set. Normally on the command line, a 'cleartool setview' command is issued. This sets a view context for commands to access the files through the ClearCase MVFS.

Problem

In the context of an CloudBees CD (CloudBees Flow) step, the 'cleartool setview' command does not work the same way.

Solution

CloudBees CD (CloudBees Flow)'s step definition has the flexibility to allow several ways of doing this. There are three alternatives for running commands in the context of a dynamic view within a step:

  1. The shell for the command block can be specified as the 'setview' command. All commands in the command step will run in the context of the view. To do this, set the 'shell' option in the step to:

     cleartool setview -exec "source {0}" my_View

    or

     cleartool setview -exec ". {0}" my_View

    (depending on default shell for user)

  2. If only one or two commands need to be run, the 'cleartool setview -exec' command can be used in the command step. For example:

     cleartool setview -exec "cd /vobs/mysrc; make" my_View
  3. The 'cleartool startview' command can be used with view-extended naming, instead of 'cleartool setview', within the command step. An example of this is:

     cleartool startview my_Viewcd /view/my_View/vobs/mysrcmake