You are on page 1of 36

► ► ► Module 1

Getting Started

IBM Software Group

Essentials of Rational ClearCase


Module 1: Getting Started

Topics
Objectives............................................................................................................ 1-2
Software Development and Change...................................................................... 1-3
Typical Developer ClearCase Workflow................................................................ 1-9
Typical Workflow: Setting Up Your Workspace................................................... 1-10
Types of Views ................................................................................................... 1-17
Creating a Dynamic View in the File Browser...................................................... 1-22
Starting a Dynamic View from CLI ...................................................................... 1-26
Mounting a VOB for Dynamic Views .................................................................. 1-29
Accessing Online Help ....................................................................................... 1-32

© Copyright IBM Corp. 2003 1-1


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

Objectives

Objectives
Upon completing this module, you should be able to:
Š 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

1-2 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

Software Development and Change

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 of


sources. If not managed, change can overwhelm a project.

© Copyright IBM Corp. 2003 1-3


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

Change Causes Developers Pain

Change Causes Developers Pain


Š Working in isolation, you can’t “see” code changes made
by team members
Š You can’t work in parallel on files that a co-worker is
modifying
Š You frequently lose time and have to redo work because of
lost defects or overwritten code
Š You have trouble determining which versions of the code
you should be working on
Š You have difficulty answering your manager’s questions
about project status
Š You don’t know who on the team is working on what
Š You have no idea which versions of files went into a build
4

1-4 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

Software Configuration Management (SCM)

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 that


deals with managing change to software.

© Copyright IBM Corp. 2003 1-5


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

Software Configuration Management (cont.)

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.

1-6 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

ClearCase Implements SCM

ClearCase Implements SCM


Š Version control Š Workspace management
ƒ Version all types of ƒ Work in parallel with
files and directories other developers

Š Build management Š Process control


ƒ Ensure the integrity of ƒ Record and report
all software elements actions, history, and
ƒ Accurately reproduce milestones
every release ƒ Customize process
ƒ Trace and reproduce
builds

ClearCase provides tool support in the following areas:


Version control — It provides a repository for versioned objects and associated
metadata, called a versioned object base, or VOB.
Workspace management — It allows you to create workspaces that give project
members access to a project’s shared versioned objects. These independent
workspaces, or views, enable parallel development.
Build management — It provides version selection for building software, and record
keeping, which allows you to accurately reproduce any build.
Process control — ClearCase provides tools for implementing site-specific policies.

© Copyright IBM Corp. 2003 1-7


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

ClearCase Roles

ClearCase Roles
Š ClearCase developer Š ClearCase integrator
ƒ Set up workspace ƒ Create integration
ƒ Make changes workspace
ƒ Integrate changes ƒ Create baselines
ƒ Update workspace ƒ Build components

Š ClearCase configuration Š ClearCase administrator


manager ƒ Set up hardware
ƒ Write CM plan environment
ƒ Design development ƒ Implement development
environment environment
ƒ Establish CM Policies ƒ Maintain hardware and
ƒ Assign and schedule work development
ƒ Monitor project status environments
8

There are a number of tasks that must be performed in a ClearCase environment. Roles
do not correspond to individuals. In some organizations, one person may fill more than
one role, for example, ClearCase administrator and configuration manager or
configuration manager and integrator.

1-8 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

Typical Developer ClearCase Workflow

Typical Developer ClearCase Workflow

In this course, you learn to perform the tasks outlined in the typical developer
workflow. As a developer, you will find yourself performing these tasks over and over
again.
The first three modules of the course teach you to perform these tasks. The labs at the
end of each module allow you to practice.
This workflow assumes the use of dynamic views. You learn more about dynamic views
later in this module.

© Copyright IBM Corp. 2003 1-9


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

Typical Workflow: Setting Up Your Workspace

Typical Workflow: Setting Up Your Workspace

10

In the remainder of this module, you learn the concepts and skills you need to set up
your own workspaces in 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.
Module 1 - Getting Started

What Is a Versioned Object Base (VOB)?

What Is a Versioned Object Base (VOB)?


Š A permanent, read-only data repository that:
ƒ Stores files, directories, and
metadata
ƒ Stores version-controlled data
ƒ Displays its contents as files
in a file system
ƒ Stores anything that can be
represented as a file or directory
ƒ Can be replicated in two or more sites

11

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

© Copyright IBM Corp. 2003 1 - 11


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

Projects and VOBs

Projects and VOBs


Š A project can span more than one VOB
Š Multiple projects can share common VOBs

12

The ClearCase administrator or configuration manager generally sets up VOBs for a


project. A project can have one or multiple VOBs. Multiple projects can share the same
VOBs. Administrators can symbolically link VOBs together so that they appear to the
user as a single directory tree.
There is no single way to organize VOBs for a project. Many organizations set up VOBs
to correspond with their system architecture. For example, a project that is building a
new publishing software application might have the following system components and
corresponding VOBs:
• Database
• Word processor
• File manager

1 - 12 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

What Is an Element?

What Is an Element?
Š 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
13

An element is any file or directory that is under source control in ClearCase, which
could include source files, directories, documents, binary files, and data libraries.

© Copyright IBM Corp. 2003 1 - 13


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

What Is a Version?

What Is a Version?
Š 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

14

Each time you check in a file or directory that is under source control, ClearCase
creates a new version of it. The versions represent the history of the element's evolution
through each stage of its development. You can access any previous version of an
element.

1 - 14 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

What Is a View?

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

15

A view is the ClearCase mechanism that allows you to access versions of elements
stored in a VOB from standard development tools. When you create a view, you set up
your 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 a
different 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.

© Copyright IBM Corp. 2003 1 - 15


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

What Is a Configuration Specification?

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

16

Each view has its own configuration specification, a set of ordered rules that determine
which version of VOB elements are “visible” in a view.
Configuration specification is often abbreviated to config spec.

1 - 16 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

Types of Views

Types of Views

17

Except in ClearCase LT, when you create a view, you must choose whether it is a
dynamic or a snapshot view. A dynamic view uses the ClearCase multiversion file
system (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 provide
immediate, 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 build auditing
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 Software
with ClearCase manual.

© Copyright IBM Corp. 2003 1 - 17


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

Which Type of View Should I Use?

Which Type of View Should I Use?

Dynamic Snapshot
• You want to access • You are using Win 9X,
elements in repositories Win ME, or ClearCase
without copying them to LT, which do not
your computer support dynamic views
• You want the view to • You want to work
reflect changes made by disconnected from the
other team members at network
all times
• You do not need build
• Your project uses build avoidance
auditing

18

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 a
snapshot 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 Building
Software manual.

1 - 18 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

Structure of a Dynamic View

Structure of a Dynamic View

19

Every dynamic view has a view storage directory, which ClearCase uses to keep track
of which versions are checked out to your view and to store view-private files (checked
out files or files not under source control in ClearCase).
The view’s 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 element
versions 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.

© Copyright IBM Corp. 2003 1 - 19


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

Structure of a Snapshot View

Structure of a Snapshot View

20

A snapshot view creates a view root directory into which it loads (copies) files and
directories 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 VOB
elements are loaded into the view. The files are read-only until checked out. Upon
checkout, a read/write copy is available locally.
Periodically, a snapshot view must be updated to keep current with changes to data
within the VOB.
You learn more about creating and working with snapshot views later in this course.

1 - 20 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

Intro to ClearCase File Browser

Intro to ClearCase File Browser


Operational
buttons

Current
working
directory

File and directory information

21

To open the File Browser:


• From the CLI, type xclearcase.

© Copyright IBM Corp. 2003 1 - 21


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

Creating a Dynamic View in the File Browser

Creating a Dynamic View in the File Browser


1
To create a view, click
View > Create.

22

You cannot start xclearcase unless you already have a view created. Therefore, you
must 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 it
will be to others:
umask Effect on Your View
002 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.

1 - 22 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

Creating a Dynamic View in the File Browser (cont.)

Creating a Dynamic View in the File Browser (cont.)


2
Select Dynamic
View.
3
Choose a view
name (or view-tag).

4
Click Advanced Options to
specify the location of the
view storage directory.

23

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 areas
by using a consistent extension for their directories: xxx.vws for dynamic views and
xxx.sv for snapshot views.

© Copyright IBM Corp. 2003 1 - 23


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

Creating a Dynamic View in the File Browser (cont.)

Creating a Dynamic View in the File Browser (cont.)


5
Confirm the view information, and then
click Continue.

24

The Confirm window displays information about the view that is being created. Click
Continue to finish creating the view.

1 - 24 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

Creating a Dynamic View from CLI

Creating a Dynamic View from CLI


mkview -tag dynamic-view-tag
dynamic-view-storage-pname

% cleartool mkview -tag pat_r2_dev


/home/pat/pat_r2_dev.vws

Must exist Must NOT exist

Created View.
Host-local path: saturn:/home/pat/pat_r2_dev.vws
Global path:/net/saturn/home/pat_r2_dev.vws
It has the following rights:
User : pat : rwx
Group : user : r-x
Other : : r-x
25

In most cases, slides in this course contain abbreviated command syntax. For complete
command 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 working
storage. You can name the view storage anything you choose. However, it is a good
idea 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 on
another workstation.
View permissions are determined by the user’s umask value at the time when the view
is created.

© Copyright IBM Corp. 2003 1 - 25


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

Starting a Dynamic View from CLI

Starting a Dynamic View from CLI


setview view-tag

Š Starts a dynamic view


Š Sets the specified view to your current working
view
Š Spawns a shell process that is set to the
dynamic view
% cleartool setview pat_r2_dev
<pat_r2_dev>%

26

You can “nest” views by setting a dynamic view while in a dynamic view.
<pat_r2_int>% cleartool setview alex_r2_dev
<alex_r2_dev>%

1 - 26 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

Starting a Dynamic View from the File Browser

Starting a Dynamic View from the File Browser


1
Click View > Set.

2
Select the view tag.

27

© Copyright IBM Corp. 2003 1 - 27


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

Displaying Your Current View

Displaying Your Current View

pwv [-short] [-wdview | -setview | -root]

<pat_r2_dev_view>% cleartool pwv


Working directory view: ** NONE **
Set view: pat_r2_dev_view

28

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 displays
the view-tag set in the current shell.

1 - 28 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

Mounting a VOB for Dynamic Views

Mounting a VOB for Dynamic Views

mount [-options mount options] {vob-tag | -all}

Š 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

% cleartool mount /vobs/Hardware

29

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 to
be 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 its
VOB-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 private
VOB. 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 this
command to a script that mounts all public VOBs each time you start ClearCase.

© Copyright IBM Corp. 2003 1 - 29


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

Accessing the VOB in the File System

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 all
mounted VOBs can be accessed
/vobs

/VobC /VobB /VobA

All mounted VOBs are


visible under /vobs

30

The path to VobA is /vobs/VobA.


Examples:
% ls /vobs/VobA
bin lost+found src
% ls /vobs/VobB
common lost+found include

1 - 30 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

Why Is the VOB-tag Directory Empty?

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
% ls
bin lost+found src

31

To see a VOB in a view, mount the VOB and set into a dynamic view. If a view is not
set, the VOB appears to be empty.

© Copyright IBM Corp. 2003 1 - 31


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

Accessing Online Help

Accessing Online Help


Access ClearCase
Use the
Help from the CLI common UNIX
or from the man page
command to
File Browser view the
reference
manual

Use the Help option to


view command usage

32

1 - 32 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

Accessing Online Help (cont.)

Accessing Online Help (cont.)

33

You can access Help from the File Browser main menu.

© Copyright IBM Corp. 2003 1 - 33


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

Accessing Online Help (cont.)

Accessing Online Help (cont.)

Online Manuals

34

1 - 34 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Module 1 - Getting Started

Module Review

Module Review
Š What is SCM?
Š How does ClearCase help you manage change to
software?
Š What tasks are involved in setting up your
workspace?
Š 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?

35

© Copyright IBM Corp. 2003 1 - 35


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Essentials of Rational ClearCase

Module Lab

Module Lab
Š In this lab, you will:
ƒ Launch ClearCase GUI
ƒ Create a dynamic view
ƒ Mount a VOB

36

1 - 36 © Copyright IBM Corp. 2003


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

You might also like