create_baseline_record.pl
The create_baseline_record.pl script is an example of how to use the HCL VersionVault API to create and populate an ALMBaseline record.
The create_baseline_record Perl script creates an ALMBaseline record. This operation connects the new ALMBaseline record back to the UCM baseline. It populates the ALMBaseline record with the new ALMActivities it finds. The ALMBaseline record includes references to the ALMActivity records found in the UCM baseline. The script runs a comparison with the previously stored ALMBaseline record. The script searches the UCM activities to find the activities delivered or rebased to a stream, and creates references to ALMActivities on the ALMBaseline record. You do not need to create an ALMBaseline record for every UCM baseline.
- Activities are listed in a BTBuild record
If you create a BTBuild record that is based on the ALMBaseline record, The create_build_record script creates a reference from the BTBuild record to the ALMBaseline record that was used to create the BTBuild. This association ensures that ALMActivities are listed in a BTBuild record. The BTBuild represents the build that the UCM and ALMActivities can be found in.
- BTBuild references appear on an ALMActivity record
The Fixed_In_Baseline field on the ALMActivity record displays which ALMBaselines and BTBuilds the ALMActivity is part of. For each found ALMBaseline record there may be several BTBuild records found.
- The ALMActivity record references the ALMTask record.
The Activities field of the ALMTask record displays which Fixed in Baselines and BTBuilds the ALMActivity participates in.
You can build, test, and release at the component level by creating baselines. A product offering might then include all the component baselines in the offering. In this example, the product is composed of all the components. To simulate this in non-UCM you can use these command line options: -add_composed_of_baseline <baseline> and -add_pvob_or_location <location>. You must use both of these options for each composite baseline. Given a baseline and pvob name, a corresponding ALM record reference is added to the new baseline record in the Composed of Baselines field.
The create_baseline_record.pl script can be run from the command
line and has a -help
option for information on all
of the command line options.
Setting up a baseline record in a new project
A
new project can be any project with no prior UCM work done in it,
or a new project that is created to work with ALM. Imported baselines
in UCM are labels imported from HCL
VersionVault and
include initial component baselines. For imported baselines to determine
the stream, you can pass the stream into the create_baseline_record.pl
script with the -ucmstream
option, or you can create
a new baseline in the project. You need at least one completed activity
to create a baseline. If you pass this new baseline into the create_baseline_record.pl
script, the script can determine the stream since it was created in
the project and not imported. If, at a later time, you import a label,
you must make a baseline in the project afterwards and use this new
baseline with the create_baseline_record.pl script.
Note: If you force a baseline with the mkbl -identical option, it causes dependencies on all components in the project which may prevent you from reconfiguring the project in the future.
Command line examples
The Perl script is located in the pkg_util directory for the ALMWork package version that you are using (for example, <install directory>\IBM\ClearQuest\packages\ALMWork\1.0\pkg_util for Windows™, and in <install directory>/IBM/ClearQuest/packages/ALMWork/1.0/pkg_util for the UNIX™ system and on Linux™). You can copy the example scripts into your build environment and customize them.
Updated versions of the scripts are provided with each new release of ALM. If you have customized copies of the scripts, you should compare the new example scripts for any changes and apply those changes to your custom scripts, if necessary.
set ALM="C:\path\to\almscripts"
ratlperl "%ALM%\create_baseline_record.pl" ^
-user ReleaseEngineer -pw "" -dbname ALM -dbset CQMS.ALM.HOST ^
-projectid ALM00000002 ^
-baseline BASELINE01 ^
-pvob project_vob01 ^
-logfile %ALM%\logs\BASELINE01.log
ALM="/path/to/almscripts"
cqperl "${ALM}/create_baseline_record.pl" \
-user ReleaseEngineer -pw "" -dbname ALM -dbset CQMS.ALM.HOST \
-projectid ALM00000002 \
-baseline BASELINE01 \
-pvob project_vob01 \
-logfile "${ALM}/logs/BASELINE01.log"