Use Cases and Best Practices

Make sure that IBM Application Discovery is installed, configured, and up and running before you get into these use cases.

All the configurations (files) that are considered as prerequisites to run the batch commands are put in place and below you can find some best practices and samples that can be applied in any environment.

Details on how and when to use these batch commands are provided and you can use any scripting method to invoke and execute, entirely based on your needs.

Note: It is important to follow the same order as shown below when you invoke the IBM Application Discovery batch commands.

1. Scheduling periodic updates for IBM AD Build Client projects

a. IBM® ADDI - GIT server integration

Prerequisites:
  • Any Git Client must be installed on the machine where IBM AD Build Client is located.
  • The GIT Repo(s) that contain the source code and is about to be loaded/analyzed in ADDI, must be cloned and available for IBM AD Build Client.
Create a batch file that triggers the following actions:
  • Synchronize (update, add, delete) the existing members in projects MyProject1, MyProject2, and MyProject3 so that they are up-to-date.
  • Run the Make process so that only the modified members (changed, added) are built and the information is refreshed in the repository.

The content of the .bat file:

REM  ------------------------  Get the latest sources from Git -----------
cd <Location of the Git Repository>
git pull     
        
REM ------------------------- Run the local SYNC process -----------------------
IBMApplicationDiscoveryBuildClient.exe /umm1 MyProject1
IBMApplicationDiscoveryBuildClient.exe /umm1 MyProject2
IBMApplicationDiscoveryBuildClient.exe /umm1 MyProject3

REM ------------------------------ Run Make---------------------------------------
IBMApplicationDiscoveryBuildClient.exe /m1 MyProject1 /m2 y /m3 y
IBMApplicationDiscoveryBuildClient.exe /m1 MyProject2 /m2 y /m3 y
IBMApplicationDiscoveryBuildClient.exe /m1 MyProject3 /m2 y /m3 y
Note:
  • For the example above, it is assumed that all 3 projects are part of the same GIT Repository, therefore a single GIT Clone command is executed.
  • The Synchronization File please make sure it is configured to execute Local Synchronization, as it is mentioned in the distributed sample here: <IBM AD Build Client installation folder>\Bin\Release\Samples\Background_Actions\synchronizeBASample.txt.
  • The .bat file can be scheduled by using, for example, Windows Scheduler, so that it can be triggered on a daily, weekly, or monthly basis (depending on how often the source is changed and needs to be updated). For more information, see Setting up Automatic Updates with Windows Scheduler.
  • The Synchronize and Make processes, depending on the number of changes that are processed, they may be time consuming, therefore, based on your environment, set the scheduler to run when the users are not using the projects for analysis.

To learn more about GIT support from ADDI, including the local synchronization process, CLI commands and automation flow, and how to automatically populate and update ADDI projects in GIT, see ADDI and Git Support - Part 1 and ADDI and Git Support - Part 2 .

b. IBM ADDI - Integration with Source Control Management Systems based on the host(CA Endevor, Changeman ZMF) and with PDS Libraries

Create a batch file that triggers the following actions:
  • Synchronize (update, add, delete) the existing members in projects MyProject1, MyProject2, and MyProject3 so that they are up-to-date.
  • Run the Make process so that only the modified members (changed, added) are built and the information is refreshed in the repository.

The content of the .bat file:

IBMApplicationDiscoveryBuildClient.exe /umm1 MyProject1
IBMApplicationDiscoveryBuildClient.exe /umm1 MyProject2
IBMApplicationDiscoveryBuildClient.exe /umm1 MyProject3
IBMApplicationDiscoveryBuildClient.exe /m1 MyProject1 /m2 y /m3 y
IBMApplicationDiscoveryBuildClient.exe /m1 MyProject2 /m2 y /m3 y
IBMApplicationDiscoveryBuildClient.exe /m1 MyProject3 /m2 y /m3 y
Note:
  • The .bat file can be scheduled by using, for example, Windows Scheduler, so that it can be triggered on a daily, weekly, or monthly basis (depending on how often the source is changed and needs to be updated). For more information, see Setting up Automatic Updates with Windows Scheduler.
  • The Synchronize and Make processes, depending on the number of changes that are processed, they may be time consuming, therefore, based on your environment, set the scheduler to run when the users are not using the projects for analysis.

2. Automatically upgrade projects repositories and run a build as soon as a new version of IBM AD Build Client is installed

Create a batch file that triggers the following actions:
  • Upgrade the repository for projects MyProject1, MyProject2, and MyProject3 (found in the RepListofProjects.txt configuration file).
  • Execute a build (full build) on the mentioned projects.
The content of the .bat file to run multiple Build Client instances sequentially.
IBMApplicationDiscoveryBuildClient.exe /ru  "\\AppServer\IBMAD\Conf\Logs\RepUpgrade.log" "\\AppServer\IBMAD\Conf\RepListofProjects.txt" 
IBMApplicationDiscoveryBuildClient.exe /fb MyProject1
IBMApplicationDiscoveryBuildClient.exe /fb MyProject2
IBMApplicationDiscoveryBuildClient.exe /fb MyProject3
The content of the .bat file to run multiple Build Client instances in parallel.
IBMApplicationDiscoveryBuildClient.exe /ru  "\\AppServer\IBMAD\Conf\Logs\RepUpgrade.log" "\\AppServer\IBMAD\Conf\RepListofProjects.txt" 
start /b "" "C:\Program Files\IBM Application Discovery and Delivery Intelligence\IBM Application Discovery Build Client\Bin\Release\IBMApplicationDiscoveryBuildClient.exe" /fb MyProject1
TIMEOUT 1
start /b "" "C:\Program Files\IBM Application Discovery and Delivery Intelligence\IBM Application Discovery Build Client\Bin\Release\IBMApplicationDiscoveryBuildClient.exe" /fb MyProject2
TIMEOUT 1
start /b "" "C:\Program Files\IBM Application Discovery and Delivery Intelligence\IBM Application Discovery Build Client\Bin\Release\IBMApplicationDiscoveryBuildClient.exe" /fb MyProject3
TIMEOUT 1

3. End to end flow in IBM AD Build: Create new projects, associate an existing z/OS Connection to projects, get the source code based on the host in PDS libraries and Endevor SCM (by using the Synchronize feature), build projects

Create a batch file that triggers the following actions:
  • Create three new projects: MyProject4, MyProject5, and MyProject6 (as configured in MyProject4.ini, MyProject5.ini and MyProject6.ini).
  • Associate the existing z/OS® Connection: Lpar1 to the newly created projects (as defined in zOSConf.ini).
  • Get the source code from the host for the mentioned projects by using the Synchronization feature (as configured in SyncProjectConf.txt).
  • Run a build (full build) on the mentioned projects.

The content of the .bat file:

IBMApplicationDiscoveryBuildClient.exe /np "\\AppServer\IBMAD\Conf\MyProject4.ini"
IBMApplicationDiscoveryBuildClient.exe /np "\\AppServer\IBMAD\Conf\MyProject5.ini"
IBMApplicationDiscoveryBuildClient.exe /np "\\AppServer\IBMAD\Conf\MyProject6.ini"
IBMApplicationDiscoveryBuildConfiguration.exe /ba "\\AppServer\IBMAD\Conf\zOSConf.ini"
IBMApplicationDiscoveryBuildClient.exe /umm1 MyProject4
IBMApplicationDiscoveryBuildClient.exe /umm1 MyProject5
IBMApplicationDiscoveryBuildClient.exe /umm1 MyProject6
IBMApplicationDiscoveryBuildClient.exe /fb MyProject4
IBMApplicationDiscoveryBuildClient.exe /fb MyProject5
IBMApplicationDiscoveryBuildClient.exe /fb MyProject6

4. Delete one or a set of projects in batch mode

Run as standalone or create a batch file that deletes projects MyProject4 and MyProject6 (as configured in DeletePj.ini).

IBMApplicationDiscoveryBuildConfiguration.exe /ba "\\AppServer\IBMAD\Conf\DeletePj.ini"
The content of the DeletePj.ini file:
[ProjectsActions]
DeleteProject=MyProject4,MyProject6