Code Pipeline CLI (IspwCLI.bat)
The Code Pipeline CLI (IspwCLI.bat) is a command-line interface used to automate interactions with BMC AMI DevX Code Pipeline from developer workflows and CI/CD pipelines. The CLI enables non-interactive execution of Code Pipeline operations, allowing integration with automation tools such as Jenkins, Azure DevOps, and other CI/CD platforms.
The Code Pipeline CLI is used to:
- Synchronize changes from a Git repository into a Code Pipeline container.
- Load components into Code Pipeline using repository path/type mappings.
- Generate previously loaded components.
- Build components according to Code Pipeline rules.
- Download components from Code Pipeline containers to a local workspace
Executables
Depending on the installation package and operating system, the following executables are available:
| Executable | Description |
|---|---|
| IspwCLI.bat | Executes Code Pipeline operations |
| SCMDownloaderCLI.bat | Downloads components from Code Pipeline |
Prerequisites
The following prerequisites must be met before using the Code Pipeline CLI (IspwCLI.bat):
| Category | Requirement |
|---|---|
| System and network requirements |
|
| Authentication requirements | A valid Code Pipeline user ID and password are available, or Certificate-based authentication is configured using one of the following:
|
| Environment configuration |
|
| Git requirements (for synchronization operations) |
|
| Configuration file requirements (for load, generate, and build operations) |
|
| Permissions |
|
Command structure
Code Pipeline CLI commands use a consistent structure that includes connection details, Code Pipeline context information, and an operation with its associated parameters.
-host <host> -port <port> \
-id <user> -pass <password> \
-code <codepage> -timeout <minutes> \
-ispwServerConfig <runtimeConfig> \
-ispwServerStream <stream> \
-ispwServerApp <application> \
-ispwCheckoutLevel <level> \
-operation <operationName> \
[operation-specific parameters]
Each command specifies a single operation. Additional parameters are required or optional depending on the operation being executed.
Operations
The Code Pipeline CLI supports the following operations:
- syncGitToIspw: Synchronize content from a Git repository into Code Pipeline
- load: Load components into Code Pipeline using path mappings
- generate: Generate previously loaded components
- build: Build generated components
Each operation is described in the following sections, including required parameters, optional parameters, and the resulting behavior.
Synchronize Git content into Code Pipeline
The syncGitToIspw operation is used to synchronize files or commits from a Git repository into Code Pipeline containers. For example:
-host cw09.bmc.com -port 47624 \
-id pinmxj0 -pass ****** \
-code 1047 -timeout 0 \
-ispwServerConfig TPTP \
-gitRepoUrl https://bitbucket.zeng.bmc.com/scm/~jarora/rjk2.git \
-gitUsername johnxyz -gitPassword ****** \
-gitBranch master \
-gitCommit COB/TPROG01.cbl \
-gitFromHash -1 \
-ispwServerStream PLAY \
-ispwServerApp PLAY \
-ispwServerSubAppl PLAY \
-ispwCheckoutLevel DEV1 \
-ispwContainerCreation per-commit \
-gitLocalPath rjk2 \
-targetFolder rjk2 \
-operation syncGitToIspw
-ispwConfigPath ispwconfig.yml
Required parameters
| Parameter | Description |
|---|---|
| -operation syncGitToIspw | Specifies the synchronization operation |
| -gitRepoUrl | Git repository URL |
| -gitBranch | Git branch name |
| -gitCommit | Commit hash or colon-delimited list of file paths |
| -ispwServerConfig | Code Pipeline runtime configuration |
| -ispwServerStream | Code Pipeline stream name |
| -ispwServerApp | Code Pipeline application name |
| -ispwCheckoutLevel | Level to check components out to |
| -ispwConfigPath | Path to the ispwconfig.yml file |
Optional parameters
| Parameter | Description |
|---|---|
| -gitFromHash | Starting commit hash for incremental or multibranch synchronization |
| -gitLocalPath | Local Git repository path |
| -ispwServerSubAppl | Code Pipeline sub-application |
| -ispwContainerCreation | Container creation mode (for example, per-commit). The per-commit and per-branch modes in ISPW CLI define the frequency at which new containers (assignments or tasks) are generated during Git-to-Code Pipeline synchronization or load operations. |
| -targetFolder | Local folder for synchronized content |
The following are the execution outcome:
- Files or commits from the Git repository are synchronized into a Code Pipeline container.
- A container is created based on the specified container creation mode.
- The container is associated with the specified application, stream, and level.
How syncGitToIspw works
The syncGitToIspw operation synchronizes source files stored in a Git repository with components managed in Code Pipeline. The CLI retrieves the specified files or commits from Git and uploads them to Code Pipeline according to the configuration defined in ispwconfig.yml.
Git Repository
│
│ (gitFromHash + gitCommit determine the sync range)
▼
Topaz CLI (syncGitToIspw)
│
│ Uses configuration from ispwconfig.yml
▼
ISPW Server
│
▼
Updated ISPW Components
Example: syncGitToIspw command with Git parameters
The following example demonstrates how the syncGitToIspw operation can be used in a Jenkins pipeline to synchronize files from a Git repository to Code Pipeline. This example illustrates how the gitCommit and gitFromHash parameters interact when determining which files are synchronized.
-host "cw09" -port "47624" -id "PINMXJ1" -pass ********
-protocol None -code 1047 -timeout "0"
-targetFolder C:\ProgramData\Jenkins.jenkins\workspace\sync_git_master
-data C:\ProgramData\Jenkins.jenkins\workspace\sync_git_master\TopazCliWkspc
-ispwServerConfig TPTP -ispwServerStream PLAY -ispwServerApp PLAY
-ispwServerSubAppl PLAY -ispwCheckoutLevel DEV1
-ispwConfigPath ispwconfig.yml -ispwContainerCreation per-commit
-gitUsername "username" -gitPassword ********
-gitRepoUrl "https://github.bmc.com/ISPW-Eclipse/rjk2.git
-gitBranch master -gitFromHash -1
-gitLocalPath C:\ProgramData\Jenkins.jenkins\workspace\sync_git_master
-gitCommit "Jenkinsfile:ASM/CLASMS10.asm:ASM/CLASMS09.asm:ASM/CLASMM09.asm:ispwconfig.yml:ASM/TRIMAINA.asm"
The following table describes the parameters used in this example:
| Parameter | Description |
|---|---|
| -targetFolder | -targetFolder C:\ProgramData\Jenkins.jenkins\workspace\sync_git_master
Example: -targetFolder C:\ProgramData\Jenkins.jenkins\workspace\sync_git_master -ispwConfigPath ispwconfig.yml The CLI resolves the configuration file as: C:\ProgramData\Jenkins.jenkins\workspace\sync_git_master\ispwconfig.yml Single workspace contains Git repository, configuration files, and temporary operation files |
| -gitLocalPath | -gitLocalPath C:\ProgramData\Jenkins.jenkins\workspace\sync_git_master
Example: sync_git_master/ ├── .git/ (Git metadata) ├── ASM/ │ ├── CLASMS10.asm (Mainframe sources) │ ├── CLASMS09.asm │ ├── CLASMM09.asm │ ├── TRIMAINA.asm │ ├── CLASMM01.asm │ ├── CLASMM06.asm │ ├── CLASMM07.asm │ ├── CLASMM05.asm │ └── CLASMM02.asm ├── Jenkinsfile └── ispwconfig.yml (ASM to ISPW path mappings) |
| -gitFromHash | -gitFromHash -1
|
| -gitCommit | -gitCommit "Jenkinsfile:ASM/CLASMS10.asm:ASM/CLASMS09.asm" This parameter accepts either:
|
Relationship between gitFromHash and gitCommit
These parameters work together to define the sync range:
| gitFromHash | gitCommit | Sync Behavior |
| -1 | File list | Full history is considered, but only the listed files are uploaded. |
| -1 | Commit hash | Full history up to that commit. |
| abc123 | def456 | Synchronizes changes between two commits. For example, from commit abc123 to commit def456. |
| abc123 | File list | Synchronizes only listed files starting from commit abc123. |
Common usage scenarios
- Full Baseline synchronization (Multibranch Pipeline) : For initial synchronization or when complete branch history is needed. For example:
-gitFromHash -1
-gitCommit "file1:file2:file3:..."
Here, only the changed files from the latest commit are synchronized to Code Pipeline, establishing the baseline while ignoring other repository changes. - Incremental synchronization between commits:For syncing changes between two specific commits. For example:
-gitFromHash abc123def
-gitCommit xyz789abc
Here, only changes between the two commits are synced. - Selective file synchronization: When only specific files need synchronization. For example:
-gitFromHash -1
-gitCommit "ASM/CLASMS10.asm:ASM/CLASMS09.asm"
Here, only the two ASM files are uploaded to Code Pipeline, ignoring all other repository changes.
Load components into Code Pipeline
The load operation is used to load components into Code Pipeline using repository-to-type mappings defined in the ispwconfig.yml file. For example:
-host cw09.bmc.com -port 47624 \
-id pinmxj0 -pass ****** \
-code 1047 -timeout 0 \
-ispwServerConfig TPTP \
-ispwServerStream PLAY \
-ispwServerApp PLAY \
-ispwServerSubAppl PLAY \
-ispwContainerCreation per-commit \
-operation load \
-ispwConfigPath ispwconfig.yml \
-componentFiles COB/TPROG10.cbl \
-ispwAssignDesc test \
-ispwMappingLevel dev1 \
-targetFolder rjk2
Required parameters
| Parameter | Description |
|---|---|
| -operation load | Specifies the load operation |
| -ispwConfigPath | Path to the ispwconfig.yml file |
| -componentFiles | Component file paths to load |
| -ispwMappingLevel | Target level for loading components |
| -ispwServerConfig | Code Pipeline runtime configuration |
| -ispwServerStream | Code Pipeline stream name |
| -ispwServerApp | Code Pipeline application name |
Optional parameters
| Parameter | Description |
|---|---|
| -ispwServerSubAppl | Code Pipeline sub-application |
| -ispwAssignDesc | Assignment description |
| -typeOverride | Overrides the component type resolved from path mappings |
| -targetFolder | Local folder for processing output |
The following are the execution outcome:
- Components are loaded into Code Pipeline.
- Component types are determined using the configured path mappings.
- Assignment information is recorded when provided.
Generate components
The generate operation is used to generate previously loaded components.For example
-host cw09.bmc.com -port 47624 \
-id pinmxj0 -pass ****** \
-code 1047 -timeout 0 \
-ispwServerConfig TPTP \
-ispwServerStream PLAY \
-ispwServerApp PLAY \
-ispwServerSubAppl PLAY \
-ispwContainerCreation per-commit \
-operation generate \
-ispwConfigPath ispwconfig.yml \
-componentFiles COB/TPROG10.cbl \
-ispwAssignDesc test \
-ispwMappingLevel dev1 \
-targetFolder rjk2
Required parameters
| Parameter | Description |
|---|---|
| -operation generate | Specifies the generate operation |
| -ispwConfigPath | Path to ispwconfig.yml |
| -componentFiles | Component file paths |
| -ispwMappingLevel | Mapping level |
Optional parameters
| Parameter | Description |
|---|---|
| -ispwAssignDesc | Assignment description |
| -targetFolder | Local folder for generated output |
The following are the execution outcome:
Components are generated according to Code Pipeline rules.
- Generation results are recorded in Code Pipeline history.
Build components
The build operation is used to build generated components. The component must be generated successfully before running the build operation. For example:
-host cw09.bmc.com -port 47624 \
-id pinmxj0 -pass ****** \
-code 1047 -timeout 0 \
-ispwServerConfig TPTP \
-ispwServerStream PLAY \
-ispwServerApp PLAY \
-ispwServerSubAppl PLAY \
-ispwContainerCreation per-commit \
-operation build \
-ispwConfigPath ispwconfig.yml \
-componentFiles COB/TPROG10.cbl \
-ispwAssignDesc test \
-ispwMappingLevel dev1 \
-targetFolder rjk2
Required parameters
| Parameter | Description |
|---|---|
| -operation build | Specifies the build operation |
| -ispwConfigPath | Path to ispwconfig.yml |
| -componentFiles | Component file paths |
| -ispwMappingLevel | Mapping level |
Optional parameters
| Parameter | Description |
|---|---|
| -ispwAssignDesc | Assignment description |
| -targetFolder | Local folder for build output |
The following are the execution outcome:
- Components are built according to Code Pipeline build rules.
- Build status and results are recorded in Code Pipeline.
Download components from Code Pipeline
The SCMDownloaderCLI is used to download components from a Code Pipeline container to a local directory.
Required parameters
| Parameter | Description |
|---|---|
| -host | Code Pipeline server host name or IP address |
| -port | Code Pipeline server port number |
| -id | Code Pipeline user ID |
| -pass | Code Pipeline user password |
| -code | Host code page (for example, 1047) |
| -ispwServerConfig | Code Pipeline runtime configuration |
| -ispwContainerName | Code Pipeline container name |
| -ispwContainerType | Container type identifier |
| -ispwServerLevel | Code Pipeline level |
| -scm ispwc | Specifies Code Pipeline as the SCM provider |
| -targetFolder | Local folder for downloaded components |
Optional parameters
| Parameter | Description |
|---|---|
| -timeout | Connection timeout in minutes |
| -protocol | Encryption protocol |
| -keystore | Keystore file path or reserved keystore name |
| -keystorePassword | Keystore password |
| -certificate | Base-64 encoded certificate string |
| -certificateAlias | Certificate alias |
| -ispwComponentType | Component type to download |
| -ispwDownloadAll | Downloads all components from the container when set to true |
| -ispwDownloadIncl | Includes dependent components when set to true |
| -data | Local working directory for CLI processing |
The following are the execution outcome:
- Components from the specified Code Pipeline container are downloaded to the target folder.
- Component filters and dependency options control which components are included.
Configuration file and path mappings (ispwconfig.yml)
The ispwconfig.yml file defines default connection information and repository-to-component type mappings used by the Code Pipeline CLI during load, generate, and build operations.
This file enables the CLI to determine how source files in a repository are mapped to Code Pipeline component types and applications.
The ispwconfig.yml file is used to:
- Define Code Pipeline connection defaults
- Identify the target application, stream, and runtime configuration
- Map repository paths and file extensions to Code Pipeline component types
- Control how components are interpreted during load, generate, and build operations
The following example illustrates a typical ispwconfig.yml file
ispwApplication:
application: HARY
encryptionProtocol: None
host: CW09
hostCodePage: '1047'
pathMappings:
- path: \COB
types:
- fileExtension: cbl
ispwType: COB
port: 47624
readWriteTimeout: 90
runtimeConfig: tptp
stream: TOPAZ
subAppl: HARY
sandbox: Y
Path mapping logic
Path mappings define how repository files are associated with Code Pipeline component types. Mapping is resolved using the repository path and the file extension
Example
If the following file is processed:
And the ispwconfig.yml file contains:
- A path mapping for \COB
- A file extension mapping for cbl
Then the file is loaded as the Code Pipeline component type COB.
Handling unmapped components
If a file does not match any configured path or file extension mapping, the CLI cannot determine the component type.
In this case, use the -typeOverride parameter to explicitly specify the Code Pipeline component type. This parameter forces the component to be processed as the specified type.
Example
-typeOverride COB
The ispwconfig.yml file is required for the following operations:
- load
- generate
- build
Troubleshooting
The following are the guidance to diagnose common issues when running Code Pipeline CLI commands.
| Issue | Possible cause | Resolution |
|---|---|---|
| Connection or TLS errors | Incorrect host, port, or protocol configuration | Verify the values provided for -host, -port, and -protocol. Confirm that the appropriate certificate or keystore parameters are configured when using secure connections. |
| Authentication failures | Invalid credentials or certificate configuration | Verify the user ID and password, or confirm that the keystore, certificate alias, or base-64 certificate string is valid and accessible. |
| Character encoding issues | Incorrect host code page | Validate that the correct code page is specified using the -code parameter (commonly 1047). |
| Missing files during Git synchronization | Incorrect Git branch, commit, or local path | Verify the values provided for -gitBranch, -gitCommit, and -gitFromHash. Confirm that the local Git repository path is correct and accessible. |
| Components not loaded or mapped | Missing or incorrect path mappings | Review the ispwconfig.yml file to ensure that path and file extension mappings are correctly defined. Use -typeOverride if required. |
Appendix: Command templates
The following templates provide a starting point for constructing Code Pipeline CLI commands. Replace placeholder values with environment-specific information.
Synchronize Git content template
-host <HOST> -port <PORT> \
-id <USER> -pass ****** \
-code 1047 -timeout 0 \
-ispwServerConfig <RUNTIME_CONFIG> \
-gitRepoUrl <REPO_URL> \
-gitUsername <GIT_USER> -gitPassword ****** \
-gitBranch <BRANCH> \
-gitCommit <HASH_OR_FILELIST> \
-gitFromHash -1 \
-ispwServerStream <STREAM> \
-ispwServerApp <APP> \
-ispwServerSubAppl <SUBAPPL> \
-ispwCheckoutLevel <LEVEL> \
-ispwContainerCreation per-commit \
-gitLocalPath <WORKSPACE> \
-targetFolder <WORKSPACE> \
-operation syncGitToIspw
Load, generate, and build template
-host <HOST> -port <PORT> \
-id <USER> -pass ****** \
-code 1047 -timeout 0 \
-ispwServerConfig <RUNTIME_CONFIG> \
-ispwServerStream <STREAM> \
-ispwServerApp <APP> \
-ispwServerSubAppl <SUBAPPL> \
-ispwCheckoutLevel <LEVEL> \
-ispwContainerCreation per-commit \
-operation <load|generate|build> \
-ispwConfigPath ispwconfig.yml \
-componentFiles <FILEPATH> \
-ispwAssignDesc "<DESCRIPTION>" \
-ispwMappingLevel <LEVEL> \
-targetFolder <WORKSPACE>
Code Pipeline CLI parameters and configuration
The Code Pipeline CLI synchronizes source from Git to Code Pipeline. The following are the available parameters:
Parameter | Description |
|---|---|
-assignmentPrefix | The prefix used to create the Code Pipeline assignment. |
-gitBranch <arg> | The target Git branch name |
-gitCommit <arg> | The Git commit hash (long or short) or a colon-delimited list of file paths in the workspace |
-gitFromHash <arg> | A Git hash to start syncing a list of commits which is not included in the sync, or -1 for multibranch project support |
-gitLocalPath <arg> | The location of the local Git repository |
-gitPassword <arg> | Git password |
-gitRepoUrl <arg> | Git Repository URL |
-gitUsername <arg> | Git user name |
-ispwCheckoutLevel <arg> | The test level to check components out to |
-ispwContainerCreation <arg> | The option to indicate how often to create a new Code Pipeline container |
-ispwContainerDescription <arg> | The custom description to be used for the Code Pipeline container |
-ispwServerApp <arg> | The Code Pipeline application |
-ispwServerConfig <arg> | The Code Pipeline server config |
-ispwServerStream <arg> | The Code Pipeline stream name |
-operation <arg> | The Code Pipeline operation to perform |
-targetFolder <arg> | The target folder where the output of the operation will be saved |
For an example of using the CLI (the plugin to be precise), refer to the Git to Code Pipeline Integration - A Tutorial.
Code Pipeline property settings
The following are the property settings required by the CLI parameters:
Property | Sync Git to Code Pipeline | Load operation |
|---|---|---|
stream | CLI parameter | ispwconfig.yml |
application | CLI parameter | ispwconfig.yml |
subAppl | CLI parameter | ispwconfig.yml |
assignmentPrefix | CLI parameter | ispwconfig.yml |
host | CLI parameter | ispwconfig.yml |
port | CLI parameter | ispwconfig.yml |
hostCodePage | CLI parameter | VSCode Settings (If it exists as a CLI parameter then it is overwritten by default) |
readWriteTimeout | CLI parameter | VSCode Settings (If it exists as a CLI parameter then it is overwritten by default) |
encryptionProtocol | CLI parameter | VSCode Settings (If it exists as a CLI parameter then it is overwritten by default) |
runtimeConfig | CLI parameter | ispwconfig.yml |
Examples of CLI using certificate authentication
The following are few sample certificates used by IspwCLI.bat:
With ID and Password
With keystore
With certificate base-64 string