Creating many new packages with one command
search cancel

Creating many new packages with one command

book

Article ID: 132309

calendar_today

Updated On:

Products

CA Harvest Software Change Manager - OpenMake Meister CA Harvest Software Change Manager

Issue/Introduction

We want to create a list of package names all at one time.  Is there an automated way to do this?

Environment

CA Harvest SCM all versions

Resolution

To accomplish this, create a simple text file containing a list of package names, for example:

C:\> type packagelist.txt
Package01
Package02
Package03

There is no tab delimiting or formatting, nothing else in the file except the names of the packages to create, a new package name on each line in the file.

On the Windows platform, this command will read the package name list text file you created and perform the "hcp" command for each name in the file:

set _FileName=<name of the file containing the list of package names>
for /F "tokens=*" %%i in (%_FileName%) do ( 
hcp "%%i" -b <brokername> -en <projectname> -st <statename> -usr <userid> -pw <password> -wts -oa MassCreatePackages.log
)


On Linux/Unix platforms, this command will read the package name list text file you created and perform the "hcp" command for each name in the file:

export _FileName=<name of the file containing the list of package names>
while IFS= read -r line; do
  hcp "$line" <brokername> -en <projectname> -st <statename> -usr <userid> -pw <password> -wts -oa MassCreatePackages.log 
done < "$_FileName"

Additional Information

More information on the "Create Package" command line utility is found here: hcp Command-Create Package