|
1 | | -# Mortgage Application Sample |
2 | | -The Mortgage Application sample is comprised of a COBOL application and Groovy build scripts that use IBM Dependency Based Build (DBB) APIs to build the application for execution on z/OS. The sample demonstrates the following build functions: |
3 | | -* How to use property files for build configuration |
4 | | -* How to handle build script command line arguments |
5 | | -* How to organize build scripts into main and called scripts for building specific source file types |
6 | | -* How to create new datasets, copy zFS files to datasets, invoke z/OS compilers and linkers, copy SYSPRINT datasets to zFS as log files |
7 | | -* How to scan source files to gather dependency data and store in the DBB repository for later dependency resolution |
8 | | -* How to generate a build report that contains a summary of source files built |
9 | | -* How to store build results in the DBB repository for later retrieval |
10 | | -* How to perform incremental builds by identifying changed files since the last build and discover impacted programs that need rebuilding |
11 | | -* How to run a post build process to create an UrbanCode Deploy shiplist from a saved DBB build report |
12 | | - |
13 | | -## Configuring the Mortgage Application Sample for your system |
14 | | -All of the build files are located in the `MortgageApplication/build` folder. The folder contains two properties files that need to be edited before the Mortgage Application build scripts can run successfully. The files contain instructions on what needs to be set. |
15 | | -* datasets.properties - Contains build properties for Partition Data Sets (PDS) used by Mortgage Application sample scripts |
16 | | -* build.properties - Contains default sandbox properties used by Mortgage Application build scripts. Many of these properties can be overridden using command line arguments when running the Groovy build script (see the comment block in build.groovy) |
17 | | - |
18 | | -## Build Script Organization |
19 | | -The Mortgage Application build folder contains three main build scripts and six called build scripts. The Groovy scripts are extensively commented and can be used to jump start writing build scripts for new applications. |
20 | | - |
21 | | -### build.groovy |
22 | | -This is the main build script for building the Mortgage Application. It performs build process initiation, scans the source files for dependency data, invokes called build scripts to build specific file types, generates a build report and saves build results to the DBB web application repository. The five called build scripts are |
23 | | -* BMSProcessing.groovy - Script that demonstrates how to build CICS BMS maps |
24 | | -* Compile.groovy - Script that demonstrates how to just compile a COBOL program to produce a object deck |
25 | | -* LinkEdit.groovy - Script that demonstrates how to link-edit object decks to produce a load module |
26 | | -* CobolCompile.groovy - Script that demonstrates how to compile and link-edit COBOL programs in one script |
27 | | -* MFSGENUtiltiy.groovy - Script that demonstrates how to build IMS Message Format Service (MFS) files |
28 | | -* Tools.groovy - Script that provides common utility Groovy methods used by the build scripts. |
29 | | - |
30 | | -The easiest way to invoke the build.groovy file from the Unix System Services (USS) command line is to use the build.sh shell script provided in the MortgageApplication/build folder. **NOTE: The build.sh shell script may need to be edited if the DBB installation is not located at /usr/lpp/IBM/dbb .** Invoking `build.sh` with no arguments will result in all the files listed in `MortgageApplication/build/files.txt` being scanned and built. Invoking `build.sh --help` will display the command line arguments that are supported by build.groovy. |
31 | | - |
32 | | -The build.groovy script can also be invoked from a Jenkins process server via a remote agent running on USS. It is important to note that when invoking Groovy scripts that use DBB APIs either by using Groovy directly or a tool like Jenkins that invokes Groovy, you will need to set both the Java classpath and the Java native library path to include the DBB toolkit lib directory. Example: |
33 | | -``` |
34 | | -Class path : /usr/lpp/IBM/dbb/lib/* |
35 | | -Java opts : -Djava.library.path=/usr/lpp/IBM/dbb |
36 | | -``` |
37 | | - |
38 | | -### impacts.groovy |
39 | | -The impacts.groovy script is an optional pre-build script that runs before build.groovy runs. When provided with the current build's Git hash, it will retrieve the last successful build's Git hash from the DBB web application repository and execute a `git diff` command to identify which files have changed since the last build. It then runs an impact analysis for each changed file to see what programs will need to be rebuilt. Finally it generates a buildList.txt file that can be passed to build.groovy to build just the programs that need to be built. |
40 | | - |
41 | | -In order to use impacts.groovy with build.groovy to changes need to be made to the build.groovy argument list: |
42 | | -* add option `--buildHash <hash>` where <hash> is the Git commit hash for the current build |
43 | | -* use `<workDir>/buildList.txt` as the build list file (last argument) where <workDir> is the directory where the buildList.txt was generated from running impacts.groovy. |
44 | | - |
45 | | -Since impacts.groovy requires the current Git build hash as an argument, no shell script has been provided to run the script as it is assumed that it will be run by a build processing server like Jenkins. The Jenkins Git client plugin sets the current build Git hash in environment variable $GIT_COMMIT. |
46 | | - |
47 | | -### deploy.groovy |
48 | | -The deploy.groovy script is an optional post-build script that runs after build.groovy runs. The script parses the buildReport.json file generated by the build.groovy script at the end of the build. From the build report it generates an UrbanCode Deploy (UCD) shiplist. It then runs a UCD buztool command to create a UCD z/OS component version for deployment. |
49 | | - |
50 | | - |
51 | | - |
52 | | - |
| 1 | +# Mortgage Application Sample |
| 2 | +The Mortgage Application sample is comprised of a COBOL application and Groovy build scripts that use IBM Dependency Based Build (DBB) APIs to build the application for execution on z/OS. The sample demonstrates the following build functions: |
| 3 | +* How to use property files for build configuration |
| 4 | +* How to handle build script command line arguments |
| 5 | +* How to organize build scripts into main and called scripts for building specific source file types |
| 6 | +* How to create new datasets, copy zFS files to datasets, invoke z/OS compilers and linkers, copy SYSPRINT datasets to zFS as log files |
| 7 | +* How to scan source files to gather dependency data and store in the DBB repository for later dependency resolution |
| 8 | +* How to generate a build report that contains a summary of source files built |
| 9 | +* How to store build results in the DBB repository for later retrieval |
| 10 | +* How to perform incremental builds by identifying changed files since the last build and discover impacted programs that need rebuilding |
| 11 | +* How to run a post build process to create an UrbanCode Deploy shiplist from a saved DBB build report |
| 12 | +* How to build a DB2 application package for SQL programs. |
| 13 | + |
| 14 | +## Configuring the Mortgage Application Sample for your system |
| 15 | +All of the build files are located in the `MortgageApplication/build` folder. The folder contains two properties files that need to be edited before the Mortgage Application build scripts can run successfully. The files contain instructions on what needs to be set. |
| 16 | +* datasets.properties - Contains build properties for Partition Data Sets (PDS) used by Mortgage Application sample scripts |
| 17 | +* build.properties - Contains default sandbox properties used by Mortgage Application build scripts. Many of these properties can be overridden using command line arguments when running the Groovy build script (see the comment block in build.groovy) |
| 18 | + |
| 19 | +## Build Script Organization |
| 20 | +The Mortgage Application build folder contains three main build scripts and six called build scripts. The Groovy scripts are extensively commented and can be used to jump start writing build scripts for new applications. |
| 21 | + |
| 22 | +### build.groovy |
| 23 | +This is the main build script for building the Mortgage Application. It performs build process initiation, scans the source files for dependency data, invokes called build scripts to build specific file types, generates a build report and saves build results to the DBB web application repository. The five called build scripts are |
| 24 | +* BMSProcessing.groovy - Script that demonstrates how to build CICS BMS maps |
| 25 | +* Compile.groovy - Script that demonstrates how to just compile a COBOL program to produce a object deck |
| 26 | +* LinkEdit.groovy - Script that demonstrates how to link-edit object decks to produce a load module |
| 27 | +* CobolCompile.groovy - Script that demonstrates how to compile and link-edit COBOL programs in one script |
| 28 | + * BindPackage.groovy - Script that demonstrates how to build a DB2 application package for SQL programs. Called from CobolCompile.groovy. |
| 29 | +* MFSGENUtiltiy.groovy - Script that demonstrates how to build IMS Message Format Service (MFS) files |
| 30 | +* Tools.groovy - Script that provides common utility Groovy methods used by the build scripts. |
| 31 | + |
| 32 | +The easiest way to invoke the build.groovy file from the Unix System Services (USS) command line is to use the build.sh shell script provided in the MortgageApplication/build folder. **NOTE: The build.sh shell script may need to be edited if the DBB installation is not located at /usr/lpp/IBM/dbb .** Invoking `build.sh` with no arguments will result in all the files listed in `MortgageApplication/build/files.txt` being scanned and built. Invoking `build.sh --help` will display the command line arguments that are supported by build.groovy. |
| 33 | + |
| 34 | +The build.groovy script can also be invoked from a Jenkins process server via a remote agent running on USS. It is important to note that when invoking Groovy scripts that use DBB APIs either by using Groovy directly or a tool like Jenkins that invokes Groovy, you will need to set both the Java classpath and the Java native library path to include the DBB toolkit lib directory. Example: |
| 35 | +``` |
| 36 | +Class path : /usr/lpp/IBM/dbb/lib/* |
| 37 | +Java opts : -Djava.library.path=/usr/lpp/IBM/dbb |
| 38 | +``` |
| 39 | + |
| 40 | +### impacts.groovy |
| 41 | +The impacts.groovy script is an optional pre-build script that runs before build.groovy runs. When provided with the current build's Git hash, it will retrieve the last successful build's Git hash from the DBB web application repository and execute a `git diff` command to identify which files have changed since the last build. It then runs an impact analysis for each changed file to see what programs will need to be rebuilt. Finally it generates a buildList.txt file that can be passed to build.groovy to build just the programs that need to be built. |
| 42 | + |
| 43 | +In order to use impacts.groovy with build.groovy to changes need to be made to the build.groovy argument list: |
| 44 | +* add option `--buildHash <hash>` where <hash> is the Git commit hash for the current build |
| 45 | +* use `<workDir>/buildList.txt` as the build list file (last argument) where <workDir> is the directory where the buildList.txt was generated from running impacts.groovy. |
| 46 | + |
| 47 | +Since impacts.groovy requires the current Git build hash as an argument, no shell script has been provided to run the script as it is assumed that it will be run by a build processing server like Jenkins. The Jenkins Git client plugin sets the current build Git hash in environment variable $GIT_COMMIT. |
| 48 | + |
| 49 | +### deploy.groovy |
| 50 | +The deploy.groovy script is an optional post-build script that runs after build.groovy runs. The script parses the buildReport.json file generated by the build.groovy script at the end of the build. From the build report it generates an UrbanCode Deploy (UCD) shiplist. It then runs a UCD buztool command to create a UCD z/OS component version for deployment. |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
53 | 55 |
|
0 commit comments