ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Download ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Post on 20-Dec-2015

215 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

<ul><li> Slide 1 </li> <li> ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager </li> <li> Slide 2 </li> <li> Cairo IT Team, ClearCase training, July 2004 2 Clearcase support at Mentor Graphics n Europe/middle east n North America Amr Elhusseiny Asser Sherif Ahmed Fayek Richard England Roger Moore Cairo-Egypt WV-USA </li> <li> Slide 3 </li> <li> Cairo IT Team, ClearCase training, July 2004 3 </li> <li> Slide 4 </li> <li> 4 n General Concepts n Using ClearCase On UNIX n Using ClearCase On Windows n How To work From Home (snapshot) n Build Control n UCM On Unix n UCM On Windows ClearCase Training </li> <li> Slide 5 </li> <li> Cairo IT Team, ClearCase training, July 2004 5 n Configuration Management (Concepts and Goals) n Data Storage VOBs n Meta-Data for Process Control General Concepts </li> <li> Slide 6 </li> <li> Cairo IT Team, ClearCase training, July 2004 6 General Concepts Configuration Management Concepts Tracking objects and changes to the objects Tracking the relationships and changes to the relationships between objects, Ex: o Unit tests and source o Source and requirements o Documentation and source Tracking environment information, i.e. the versions of tools used to build, etc. Tracking defects forcing changes to requirements, source, documentation, and tests Parallel development Being able to reproduce previous releases exactly </li> <li> Slide 7 </li> <li> Cairo IT Team, ClearCase training, July 2004 7 Improve the Return on Investment by: n Increasing team productivity n Increasing product quality n Managing process quality n Reducing the time to market n Reusing code when applicable General Concepts Configuration Management Goals </li> <li> Slide 8 </li> <li> Cairo IT Team, ClearCase training, July 2004 8 General Concepts Data Storage VOB (Versioned Object Base) n This is the repository where all objects (and information about those objects) is stored. n A VOB is made up of a database and storage pools. n The database contains information about elements, derived objects, cleartext, and meta-data). The storage pools contain the file system objects for the elements in the VOB. n An element is a file or directory. </li> <li> Slide 9 </li> <li> Cairo IT Team, ClearCase training, July 2004 9 General Concepts Data Storage VOB (Versioned Object Base), Cont. Cleartext is a cached version of a previously selected version of an element. A derived object is an object that was created by either a clearmake, omake, build or audit. Meta-data are bits of information that you can associate with elements. n The storage pools are subdirectories that contain the file system data for the VOB. n The element source is stored in the s pool, cleartext in the c pool, and derived objects in the d pool. </li> <li> Slide 10 </li> <li> Cairo IT Team, ClearCase training, July 2004 10 General Concepts Data Storage - Registries Registries contain information about VOBs and the way the VOBs data is accessed (a view). The registries contain typically: n A unique identification number n The object's name n Its storage path Where the object is accessible (its region) </li> <li> Slide 11 </li> <li> Cairo IT Team, ClearCase training, July 2004 11 General Concepts VOB Elements (files and directories) n n Each element is made up of versions, which make up the revision history of the element. myfile.c was created resulting in version 0. It was then modified and checked in, resulting in version 1. To create version 2, it was checked out and back in. All the work was done on the main branch of the element. </li> <li> Slide 12 </li> <li> Cairo IT Team, ClearCase training, July 2004 12 General Concepts Accessing VOB Data Using a View n A view is a collection of rules or filters applied in a specific order to produce the specific versions of the elements that you see. n In different views, the versions of the elements and the elements that one user will see may not be the same as what another user will see, even though they are looking at the same directory structure. n The rules that the view uses are set in the configuration specification. (most commonly referred to as a config spec). </li> <li> Slide 13 </li> <li> Cairo IT Team, ClearCase training, July 2004 13 General Concepts Accessing VOB Data Using a View, Cont. </li> <li> Slide 14 </li> <li> Cairo IT Team, ClearCase training, July 2004 14 General Concepts Metadata For Process Control n Labels n Attributes n Branching n Hyperlinks n Element Types n Triggers n Locks </li> <li> Slide 15 </li> <li> Cairo IT Team, ClearCase training, July 2004 15 General Concepts Labels n Identify specific versions of files. n Use labels to mark milestones in project development. n Lock them to prevent elements being added or removed inappropriately. n Apply labels to directory elements if any element in the directory will have the label applied to it. n Avoid labeling versions on branches that are only version 0. n Follow the corporate naming convention for labels: Label names are all uppercase Labels use periods and numbers to denote versions </li> <li> Slide 16 /vob/project/myfile.doc @@/main/bugfix/2 QA_LINK </li><li> Cairo IT Team, ClearCase training, July 2004 51 Find Your Way n List all VOBs &gt; cleartool lsvob * /vobs/TNT_pfgen /net/egccc1/export/vobs/vobstore/TNT_pfgen.vbs public * /vobs/IT_VOB /net/egccc1/export/vobs/vobstore/IT_VOB.vbs public /vobs/icx_software /net/egccc1/export/vobs/vobstore/icx_software.vbs public * Denotes VOBs mounted on current ClearCase client. n List all VIEWs &gt; cleartool lsview * amre_TNT_vu /net/egccc1/export/vobs/views/username_TNT_sco_vu.vws assers_develop_vu /net/egccc1/export/vobs/views/mselim_develop_vu.vws * Denotes VIEWs currently in use. </li> <li> Slide 52 </li> <li> Cairo IT Team, ClearCase training, July 2004 52 Create your Dynamic UNIX VIEW n Storage location plkviews already created on the filer CHOPIN for hosting the dynamic views for UNIX &gt; umask 2 ( to set permissions to 775 if required) &gt; cleartool mkview -tag your_view_tag stgloc plkviews Created view. Host-local path: chopin:/vol/vol2/plkviews/your_view_tag.vws Global path: /net/chopin/vol/vol2/plkviews/ your_view_tag.vws It has the following rights: User : username : rwx Group: plk : rwx Other: : r-x </li> <li> Slide 53 </li> <li> Cairo IT Team, ClearCase training, July 2004 53 Create your Snapshot Unix View n For each users machine, a storage location needs to be created by the CC support team, the standard naming is: machine-name_team-name_viewstore n A scratch area on the machine where the storage location is created needs to be shared so that it can be accessed from the path /net/machine-name/scratch-area </li> <li> Slide 54 </li> <li> Cairo IT Team, ClearCase training, July 2004 54 Create your Snapshot Unix View n To create the snapshot view in the storage location created in the scratch area on your local machine use: &gt;cleartool mkview tag your_view_tag -snap stg storage_location_name \ /net/your_machine_name/path_to_your_scratch_area/your_View_Tag n Example: &gt; cleartool mkview tag amre_test_vu snap stg md8_IT_viewstore /net/md8/export/home/users/amre/views/amre_test_vu </li> <li> Slide 55 </li> <li> Cairo IT Team, ClearCase training, July 2004 55 Working with Dynamic Views n Set a dynamic view to be your current VIEW &gt;cleartool setview your_view_tag n Print your current dynamic VIEW &gt;cleartool pwv Working directory view: ** NONE ** Set view: your_view_tag NEVER remove the view using UNIX command rm rf </li> <li> Slide 56 </li> <li> Cairo IT Team, ClearCase training, July 2004 56 Config Spec Dynamic View n View your configuration specs &gt;cleartool catcs element * CHECKEDOUT element * /main/LATEST n Edit your configuration Specs &gt;cleartool edcs element * CHECKEDOUT element * /main/LATEST Set config spec for view view-tag ? [Yes] n Set configuration Specs file &gt;cleartool setcs file_name </li> <li> Slide 57 </li> <li> Cairo IT Team, ClearCase training, July 2004 57 Working with Snapshot Views n To set a Snapshot view to be your current view all you need to do is to CD to the path of the snapshot view you created, example: &gt; cd /net/md8/export/home/users/amre/views/amre_test_vu n Next thing you need to do is to load the needed directories and files from the VOB </li> <li> Slide 58 </li> <li> Cairo IT Team, ClearCase training, July 2004 58 Adding or Modifying Load Rules You can add or modify load rules in any of the following ways: n Any time you edit and modify a snapshot views config spec, ClearCase updates the entire view. This is appropriate when you first create a view, or when you modify a views version-selection rules, but it may be cumbersome if you only want to add a few elements to the view n By using update add_loadrules. The add_loadrules option of cleartool update adds load rules to your views config spec but updates only the portion of the view that is affected by the new load rules </li> <li> Slide 59 </li> <li> Cairo IT Team, ClearCase training, July 2004 59 Add Load Rules When Editing the Config Spec n Open the views config spec for editing by doing the following: Open a shell and change to a directory in the view (Where the elements will be loaded from VOB). Use the following command to edit the config spec file: &gt; cleartool edcs ClearCase opens the views config spec in your default text editor n In your text editor, use the following syntax to create load rules: load vob-tag/element-pathname For example, the rule load /vobs/testvob loads all files and directories in the VOB named /vobs/testvob. The rule load /vobs/testvob/batch loads only the batch directory recursively. n Save the config spec and exit the text editor. n In your shell, answer Yes at the ClearCase prompt for setting the config spec. </li> <li> Slide 60 </li> <li> Cairo IT Team, ClearCase training, July 2004 60 Add Load Rules with update add_loadrules n Use the following command: &gt; cleartool update add_loadrules element-pathname Where, element-pname: names an element in the VOB namespace at a pathname that is relative to a snapshot view. n For example, the following command loads all elements in a VOB named /guivob into the view pat_v1.4_cropcircle_sv: &gt; cleartool update add_loadrules ~/pat_v1.4_cropcircle_sv/guivob n You can also use a relative pathname for the element-pathname argument. For example, these commands load all elements in the vob guivob: &gt; cd ~/pat_v1.4_cropcircle_sv &gt; cleartool update add_loadrules guivob n These commands load only the batch directory recursively: &gt; cd ~/pat_v1.4_cropcircle_sv &gt; cleartool update add_loadrules guivob/batch </li> <li> Slide 61 </li> <li> Cairo IT Team, ClearCase training, July 2004 61 Excluding Elements from Loading n ClearCase loads all directory elements recursively. To exclude some elements from loading, you can use an element rule in the config spec that selects an elements initial version. For all ClearCase elements, the initial version contains no data.. n To Exclude Elements you have to o pen the views config spec for editing Open a shell and change to a directory in the view Use the command &gt; cleartool edcs In the text editor, create an element rule that specifies the initial version of the element you want to exclude by using the following syntax: element vob-tag/element-pathname /main/0 n For example, the element rule element /guivob/interface /main/0 loads the empty version of the interface directory in /guivob, preventing any of its child elements from loading. n Save the config spec and exit the text editor. In your shell, answer Yes at the ClearCase prompt for setting the config spec. </li> <li> Slide 62 </li> <li> Cairo IT Team, ClearCase training, July 2004 62 Updating a Snapshot View n The rules in your views config spec are usually designed to select a discrete set of versions from the VOB. For example, your view is usually intended to contain a set of versions that build successfully. However, when other developers check in new versions from their views, a snapshot view may become out of date or inconsistent with the versions in the VOB n To make sure that your view contains the set of versions the config spec selects, you must update it n An update operation copies versions of elements from a VOB to your view. Only the checkin operation copies changes from your view back to a VOB </li> <li> Slide 63 </li> <li> Cairo IT Team, ClearCase training, July 2004 63 Updating the View n You can start an update operation for: The entire view At least one file or at least one directory tree n To update the view, use cleartool update with any of the following options: &gt; cleartool update command-options snapshot-view-pathname n The snapshot-view-pathname argument is optional if you enter the update command from the root directory of the view n For a description of all available command options, see the update reference page in the Command Reference </li> <li> Slide 64 </li> <li> Cairo IT Team, ClearCase training, July 2004 64 Updating the View n For example: &gt; cleartool update ~/pat_1.4_cropcircle_sv n NOTE: You can use the Update Tool to update the view instead of the command line. To start the update GUI, use the following command: &gt; cleartool update graphical snapshot-view-pathname </li> <li> Slide 65 </li> <li> Cairo IT Team, ClearCase training, July 2004 65 Updating Files and Directory Trees n To save time, you can update individual files or directories. (Rational ClearCase updates directories recursively.) Updating only specific parts of your view may eventually cause the view to contain an inconsistent set of versions Use the following command: &gt; cleartool update command_options pathnames-of-loaded-elements n NOTE: You cannot update a checked-out file. To undo changes to a checked-out file and start over with the version in the VOB, cancel the checkout </li> <li> Slide 66 </li> <li> Cairo IT Team, ClearCase training, July 2004 66 Unloading Elements n If a views config spec no longer selects an element, ClearCase removes, or unloads, it from the view. Unloading does not affect view-private files or view-private directories n Updating can cause an element to be unloaded from a view in the following situations: You remove the load rule that specifies the element (or that specifies a directory element somewhere above it) The version-selection rules no longer select any version of the element. This can happen when your config spec selects a version of the parent directory that no longer contains a version of the file element </li> <li> Slide 67 </li> <li> Cairo IT Team, ClearCase training, July 2004 67 Unloading Files n The action that ClearCase takes to unload a file depends on the files current state: For a file that is not checked out, ClearCase deletes the file from the view For a hijacked file, ClearCase appends.unloaded to the file name, unless you use update overwrite to delete hijacked files For a checked-out file, ClearCase appends.unloaded to the file name. The version remains checked out to your view </li> <li> Slide 68 </li>...</ul>