of 36
8/9/2019 03_scm271_ecc_s01
1/36
Copyright IBM Corp. 2003 1 - 1
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1Getting Started
1
IBM Software Group
Essentials of Rational ClearCase
Module 1: Getting Started
Topics
Objectives............................................................................................................ 1-2Software Development and Change...................................................................... 1-3Typical Developer ClearCase Workflow................................................................ 1-9Typical Workflow: Setting Up Your Workspace................................................... 1-10Types of Views................................................................................................... 1-17Creating a Dynamic View in the File Browser...................................................... 1-22Starting a Dynamic View from CLI ...................................................................... 1-26Mounting a VOB for Dynamic Views .................................................................. 1-29Accessing Online Help ....................................................................................... 1-32
8/9/2019 03_scm271_ecc_s01
2/36
Essentials of Rational ClearCase
1 - 2 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Objectives
2
Define software configuration management (SCM)
Explain how ClearCase implements SCM
Explain ClearCase roles
Define basic ClearCase terminology and concepts
Explain the typical developer workflow in ClearCase
Set up your ClearCase workspace
Access ClearCase Help
Upon completing this module, you should be able to:
Objectives
8/9/2019 03_scm271_ecc_s01
3/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 3
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Software Development and Change
3
Software Development and Change
Software development involves change
A defect to be fixed
An existing function to be enhanced
A new feature to be added
A new platform to support
A customer-driven special project
Internationalization
In software development, change is constant. Change requests come from a variety ofsources. If not managed, change can overwhelm a project.
8/9/2019 03_scm271_ecc_s01
4/36
Essentials of Rational ClearCase
1 - 4 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Change Causes Developers Pain
4
Change Causes Developers Pain Working in isolation, you cant see code changes made
by team members
You cant work in parallel on files that a co-worker ismodifying
You frequently lose time and have to redo work because oflost defects or overwritten code
You have trouble determining which versions of the codeyou should be working on
You have difficulty answering your managers questionsabout project status
You dont know who on the team is working on what
You have no idea which versions of files went into a build
8/9/2019 03_scm271_ecc_s01
5/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 5
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Software Configuration Management (SCM)
5
Software Configuration Management (SCM)
SCM is about
managing change
to software.
Brian White, Software Configuration
Management Strategies and
Rational ClearCase (2000)
Software Configuration Management (SCM) is the software engineering discipline thatdeals with managing change to software.
8/9/2019 03_scm271_ecc_s01
6/36
Essentials of Rational ClearCase
1 - 6 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Software Configuration Management (cont.)
6
Software Configuration Management (cont.) A successful SCM effort ensures:
Safety
Stability
Control
Auditability
Reproducibility
Traceability
Scalability
A successful SCM effort ensures:
Safety Ability to recover from failure and to prevent unauthorized use. Stability Ability to create stable, user-controlled workspaces.
Control Ability to enforce appropriate project-specific workflow controls. Auditability Ability to know what is included in a particular build. Reproducibility Ability to mark milestones and reconstruct configurations. Traceablity Ability to identify and reconstruct particular versions of a software
product. Scalability Ability to support small and large projects as well as distributed
development.
8/9/2019 03_scm271_ecc_s01
7/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 7
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
ClearCase Implements SCM
7
ClearCase Implements SCM Version control
Version all types of
files and directories
Build management
Ensure the integrity of
all software elements
Accurately reproduceevery release
Trace and reproduce
builds
Workspace management
Work in parallel with
other developers
Process control
Record and report
actions, history, and
milestones
Customize process
ClearCase provides tool support in the following areas:
Version control It provides a repository for versioned objects and associatedmetadata, called a versioned object base, or VOB.
Workspace management It allows you to create workspaces that give projectmembers access to a projects shared versioned objects. These independentworkspaces, or views, enable parallel development.
Build management It provides version selection for building software, and recordkeeping, which allows you to accurately reproduce any build.
Process control ClearCase provides tools for implementing site-specific policies.
8/9/2019 03_scm271_ecc_s01
8/36
Essentials of Rational ClearCase
1 - 8 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
ClearCase Roles
8
ClearCase Roles ClearCase developer
Set up workspace
Make changes
Integrate changes
Update workspace
ClearCase configurationmanager
Write CM plan
Design developmentenvironment
Establish CM Policies
Assign and schedule work
Monitor project status
ClearCase integrator
Create integrationworkspace
Create baselines
Build components
ClearCase administrator
Set up hardwareenvironment
Implement developmentenvironment
Maintain hardware anddevelopmentenvironments
There are a number of tasks that must be performed in a ClearCase environment. Rolesdo not correspond to individuals. In some organizations, one person may fill more thanone role, for example, ClearCase administrator and configuration manager orconfiguration manager and integrator.
8/9/2019 03_scm271_ecc_s01
9/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 9
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Typical Developer ClearCase Workflow
9
Typical Developer ClearCase Workflow
In this course, you learn to perform the tasks outlined in the typical developerworkflow. As a developer, you will find yourself performing these tasks over and overagain.
The first three modules of the course teach you to perform these tasks. The labs at theend of each module allow you to practice.
This workflow assumes the use of dynamic views. You learn more about dynamic viewslater in this module.
8/9/2019 03_scm271_ecc_s01
10/36
Essentials of Rational ClearCase
1 - 10 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Typical Workflow: Setting Up Your Workspace
10
Typical Workflow: Setting Up Your Workspace
In the remainder of this module, you learn the concepts and skills you need to set upyour own workspaces in ClearCase.
8/9/2019 03_scm271_ecc_s01
11/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 11
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
What Is a Versioned Object Base (VOB)?
11
What Is a Versioned Object Base (VOB)?
Stores files, directories, andmetadata
Stores version-controlled data
Displays its contents as filesin a file system
Stores anything that can berepresented as a file or directory
Can be replicated in two or more sites
A permanent, read-only data repository that:
A Versioned Object Base (VOB) is a repository that stores versioned-controlled files,directories, and metadata. ClearCase displays VOB contents as files in a file system.
VOBs can reside on the following systems:
Windows XP Windows 2000 Windows NT UNIX, including Red Hat Linux
8/9/2019 03_scm271_ecc_s01
12/36
Essentials of Rational ClearCase
1 - 12 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Projects and VOBs
12
Projects and VOBs A project can span more than one VOB
Multiple projects can share common VOBs
The ClearCase administrator or configuration manager generally sets up VOBs for aproject. A project can have one or multiple VOBs. Multiple projects can share the sameVOBs. Administrators can symbolically link VOBs together so that they appear to theuser as a single directory tree.
There is no single way to organize VOBs for a project. Many organizations set up VOBsto correspond with their system architecture. For example, a project that is building anew publishing software application might have the following system components andcorresponding VOBs:
Database Word processor File manager
8/9/2019 03_scm271_ecc_s01
13/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 13
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
What Is an Element?
13
A file or a directory, under source control,
stored in a ClearCase VOB
Can be any object that can be stored in a native
file system, including:
Source files
Directories
Binary files
Object libraries
Documents
What Is an Element?
An element is any file or directory that is under source control in ClearCase, whichcould include source files, directories, documents, binary files, and data libraries.
8/9/2019 03_scm271_ecc_s01
14/36
Essentials of Rational ClearCase
1 - 14 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
What Is a Version?
14
An element consists of a set of versions, organized
into a version tree
Each version represents
one revision of a file
under source control
Versions are displayed
in a workspace or view
What Is a Version?
Each time you check in a file or directory that is under source control, ClearCasecreates a new version of it. The versions represent the history of the element's evolutionthrough each stage of its development. You can access any previous version of anelement.
8/9/2019 03_scm271_ecc_s01
15/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 15
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
What Is a View?
15
What Is a View? A ClearCase mechanism that allows users access
to versions of elements in VOBs
An isolated workspace for a user or a group
Enables users to work in parallel
A viewis the ClearCase mechanism that allows you to access versions of elementsstored in a VOB from standard development tools. When you create a view, you set upyour private workspace where you can work on elements that are under source control.You can decide which VOBs or elements within VOBs you want work with. And, you
can decide which versions of the elements you want to access.
You may have multiple views, which allows you to manage different tasks by using adifferent view for each task. For example, you may have views for:
New development Bug fixes Porting activities Ad hoc configuration
A view may access multiple VOBs.
The view name is known as a view_tag.
8/9/2019 03_scm271_ecc_s01
16/36
Essentials of Rational ClearCase
1 - 16 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
What Is a Configuration Specification?
16
What Is a Configuration Specification? For each view, a set of ordered rules used to
select at most one version of each element
Determine which versions of an element are
visible in the view
Each view has its own configuration specification, a set of ordered rules that determinewhich version of VOB elements are visible in a view.
Configuration specification is often abbreviated to config spec.
8/9/2019 03_scm271_ecc_s01
17/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 17
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Types of Views
17
Types of Views
Except in ClearCase LT, when you create a view, you must choose whether it is adynamic or a snapshot view. A dynamic view uses the ClearCase multiversion filesystem (MVFS) to arrange VOB data into a directory tree; a snapshot view loads
elements onto your computer.
Dynamic views use the ClearCase multiversion file system (MVFS) to provideimmediate, transparent access to files and directories stored in VOBs.
Connected to shared storage Work on virtual copy of elements in the VOB (MVFS) Dynamic changes as new work is shared Always up-to-date Provides buildauditing
Snapshot views copy files and directories from VOBs to a directory on your computer.
Can work disconnected from shared storage
Work on local copy of elements in the VOB (native file system) Static user controls when work is shared Must be updated manually Provides optimal build performance
For more information about dynamic and snapshot views, see the Developing SoftwarewithClearCase manual.
8/9/2019 03_scm271_ecc_s01
18/36
Essentials of Rational ClearCase
1 - 18 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Which Type of View Should I Use?
18
Which Type of View Should I Use?
You are using Win 9X,
Win ME, or ClearCase
LT, which do not
support dynamic views
You want to work
disconnected from the
network
You do not need build
avoidance
You want to access
elements in repositories
without copying them to
your computer
You want the view to
reflect changes made by
other team members atall times
Your project uses build
auditing
SnapshotDynamic
Both types of views can exist on your computer at the same time.
In a dynamic view, you automatically see changes made by other team members. In asnapshot view, you must periodically update the view to stay current.
Snapshot views allow you to work disconnected from the network.
For more information on build auditing, refer to the Rational ClearCase BuildingSoftware manual.
8/9/2019 03_scm271_ecc_s01
19/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 19
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Structure of a Dynamic View
19
Structure of a Dynamic View
Every dynamic view has a view storage directory, which ClearCase uses to keep trackof which versions are checked out to your view and to store view-private files (checkedout files or files not under source control in ClearCase).
The views config spec selects the versions of elements from the VOB to display.ClearCase uses the MVFS to arrange VOB data into a directory tree. The elementversions you see displayed in the virtual file system are read-only until checked out.Upon checkout, a read/write copy becomes available in the view storage directory.
8/9/2019 03_scm271_ecc_s01
20/36
Essentials of Rational ClearCase
1 - 20 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Structure of a Snapshot View
20
Structure of a Snapshot View
A snapshot view creates a view root directory into which it loads (copies) files anddirectories from VOBs. The view root directory is often on a local computer.
By default, ClearCase locates the view storage of a snapshot view under the view root
directory.The config spec of a snapshot view includes load rules that determine which VOBelements are loaded into the view. The files are read-only until checked out. Uponcheckout, a read/write copy is available locally.
Periodically, a snapshot view must be updated to keep current with changes to datawithin the VOB.
You learn more about creating and working with snapshot views later in this course.
8/9/2019 03_scm271_ecc_s01
21/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 21
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Intro to ClearCase File Browser
21
Intro to ClearCase File Browser
File and directory information
Operationalbuttons
Currentworking
directory
To open the File Browser:
From the CLI, type xclearcase.
8/9/2019 03_scm271_ecc_s01
22/36
Essentials of Rational ClearCase
1 - 22 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Creating a Dynamic View in the File Browser
22
Creating a Dynamic View in the File Browser
1
To create a view, clickView > Create.
You cannot start xclearcase unless you already have a view created. Therefore, youmust create your first view from the CLI.
Before creating a view:
Your UNIX umask setting at the time you create your view determines how accessible itwill be to others:
umask Effect on Your View002 Members of your UNIX group can create and modify view-
private data. Other users have read-only access.
007 Members of your UNIX group can create and modify view-private data. Other users are completely excluded.
022 Only you can write view-private data.Everyone else has read-only access.
077 A completely private view.Only the view creator can read or write view-private data.
8/9/2019 03_scm271_ecc_s01
23/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 23
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Creating a Dynamic View in the File Browser (cont.)
23
Creating a Dynamic View in the File Browser (cont.)
4
Click Advanced Options tospecify the location of theview storage directory.
2
Select DynamicView.
3
Choose a viewname (or view-tag).
It is a good idea to name views so that they indicate owners and purpose, for example:
pat_r2dev_view alex_r1_bugfix
It is also a good idea to distinguish between dynamic and snapshot view storage areasby using a consistent extension for their directories: xxx.vws for dynamic views andxxx.sv for snapshot views.
8/9/2019 03_scm271_ecc_s01
24/36
Essentials of Rational ClearCase
1 - 24 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Creating a Dynamic View in the File Browser (cont.)
24
Creating a Dynamic View in the File Browser (cont.)5
Confirm the view information, and thenclick Continue.
The Confirm window displays information about the view that is being created. ClickContinue to finish creating the view.
8/9/2019 03_scm271_ecc_s01
25/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 25
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Creating a Dynamic View from CLI
25
Creating a Dynamic View from CLImkview -tag dynamic-view-tagdynamic-view-storage-pname
% cleartool mkview -tag pat_r2_dev/home/pat/pat_r2_dev.vws
Created View.
Host-local path: saturn:/home/pat/pat_r2_dev.vwsGlobal path:/net/saturn/home/pat_r2_dev.vws
It has the following rights:User : pat : rwxGroup : user : r-x
Other : : r-x
Must exist Must NOT exist
In most cases, slides in this course contain abbreviated command syntax. For completecommand syntax, see the ClearCase Reference Manual.
This syntax applies to dynamic views only.
The .vws file extension is a recommended convention; it stands for view workingstorage. You can name the view storage anything you choose. However, it is a goodidea to name view (and VOB) storage areas something that easily identifies them.
If the global path is accessible throughout the network, you can use your view onanother workstation.
View permissions are determined by the users umask value at the time when the viewis created.
8/9/2019 03_scm271_ecc_s01
26/36
Essentials of Rational ClearCase
1 - 26 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Starting a Dynamic View from CLI
26
Starting a Dynamic View from CLI
Starts a dynamic view
Sets the specified view to your current workingview
Spawns a shell process that is set to thedynamic view
setview view-tag
% cleartool setview pat_r2_dev
%
You can nest views by setting a dynamic view while in a dynamic view.
% cleartool setview alex_r2_dev
%
8/9/2019 03_scm271_ecc_s01
27/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 27
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Starting a Dynamic View from the File Browser
27
Starting a Dynamic View from the File Browser1
Click View > Set.
2
Select the view tag.
8/9/2019 03_scm271_ecc_s01
28/36
Essentials of Rational ClearCase
1 - 28 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Displaying Your Current View
28
Displaying Your Current View
% cleartool pwvWorking directory view: ** NONE **Set view: pat_r2_dev_view
pwv [-short] [-wdview | -setview | -root]
cleartool pwv displays the view-tag that is working (filtering) the current VOB directory.If the current working directory is not in a VOB, it displays **NONE**. It also displaysthe view-tag set in the current shell.
8/9/2019 03_scm271_ecc_s01
29/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 29
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Mounting a VOB for Dynamic Views
29
Mounting a VOB for Dynamic Views
The mount command activates a VOB for use on
the local workstation
You access a VOB through its unique tag name
Public VOBs are mounted on boot up and with the
mount all command
mount [-options mount options] {vob-tag| -all}
% cleartool mount /vobs/Hardware
A file system must be mounted or activated before you can use it.
VOBs are activated automatically on the host where they were created.
A private VOB is intended to be activated by a single user; a public VOB is intended tobe activated by more than one user.
The difference between a private and a public VOB is in how the VOB is mounted:
When the VOB-tag is private, you must mount the VOB explicitly, by supplying itsVOB-tag. To mount a VOB, use the cleartool mount command.
When the VOB-tag is public, you can mount the VOB explicitly, as with a privateVOB. In addition, you can mount all public VOBs in the network region at once,using the cleartool mount command with the -all option. You can add thiscommand to a script that mounts all public VOBs each time you start ClearCase.
8/9/2019 03_scm271_ecc_s01
30/36
Essentials of Rational ClearCase
1 - 30 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Accessing the VOB in the File System
30
Accessing the VOB in the File System The VOB-tag or the VOB mount point is the full
pathname with which users access VOBs
VOB-tags are regular native operating system
directories
Mount point through which allmounted VOBs can be accessed
All mounted VOBs arevisible under /vobs
/vobs
/VobA/VobB/VobC
The path to VobA is /vobs/VobA.
Examples:
% ls /vobs/VobA
bin lost+found src
% ls /vobs/VobB
common lost+found include
8/9/2019 03_scm271_ecc_s01
31/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 31
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Why Is the VOB-tag Directory Empty?
31
Why Is the VOB-tag Directory Empty? Directories beneath the VOB-tag are inaccessible
until you
Mount the VOB
Set into a dynamic view
Example:% cd /vobs/Hardware% ls
%% cleartool mount /vobs/Hardware
% cleartool setview pat_r2_dev_view% lsbin lost+found src
To see a VOB in a view, mount the VOB and set into a dynamic view. If a view is notset, the VOB appears to be empty.
8/9/2019 03_scm271_ecc_s01
32/36
Essentials of Rational ClearCase
1 - 32 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Accessing Online Help
32
Accessing Online Help
Access ClearCase
Help from the CLI
or from the
File Browser
Use thecommon UNIXman pagecommand toview thereferencemanual
Use the Help option toview command usage
8/9/2019 03_scm271_ecc_s01
33/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 33
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Accessing Online Help (cont.)
33
Accessing Online Help (cont.)
You can access Help from the File Browser main menu.
8/9/2019 03_scm271_ecc_s01
34/36
Essentials of Rational ClearCase
1 - 34 Copyright IBM Corp. 2003
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Accessing Online Help (cont.)
34
Accessing Online Help (cont.)
Online Manuals
8/9/2019 03_scm271_ecc_s01
35/36
Module 1 - Getting Started
Copyright IBM Corp. 2003 1 - 35
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module Review
35
What is SCM?
How does ClearCase help you manage change tosoftware?
What tasks are involved in setting up yourworkspace?
What is a VOB? Element? Version? View?
How do you access particular versions of elements
in a ClearCase VOB? What is the difference between a snapshot view and
a dynamic view?
How do you access online Help in ClearCase?
Module Review
8/9/2019 03_scm271_ecc_s01
36/36
Essentials of Rational ClearCase
Module Lab
36
In this lab, you will:
Launch ClearCase GUI
Create a dynamic view
Mount a VOB
Module Lab