GitHubContribute in GitHub: Edit online

Build configuration

The DBB zBuilder is configured through YAML files. These YAML files are in the build configuration directory located on z/OS UNIX and accessed by using the $DBB_BUILD environment variable.

The root configuration file is dbb-build.yaml. A sample of this file is provided ready-to-use in the build directory of the DBB toolkit installation directory. This build directory must be relocated to another z/OS UNIX location outside of the DBB installation because any existing configuration files in the build directory will be overwritten when a new DBB version is installed.

See Setting up the integrated zBuilder framework for more instructions on how to relocate the build configuration directory.

Note that the build configuration directory is intended to be centralized under the control of a z/OS build engineer or DevOps engineering team.

Directory content

After you have followed the instructions outlined in Setting up the integrated zBuilder framework, you should see the following content in the $DBB_BUILD configuration directory:

  • The dbb-build.yaml file, which defines executable build lifecycles and task configurations. This is the main DBB build configuration file and is loaded first when the zBuilder is started with the DBB CLI build command.
  • Language task configuration YAML files such as Assembler.yaml, Cobol.yaml or other YAML files referenced by the dbb-build.yaml file through include: statements.
  • A groovy/ sub-directory where you can store the Apache Groovy scripts that implement custom zBuilder tasks.
  • A default .gitattributes file for the users who decide to import the build configuration directory to a Git provider such as GitLab, GitHub or Bitbucket.

The dbb-build.yaml file

The dbb-build.yaml file is the root configuration file of the DBB build process. All the build lifecycles are defined in dbb-build.yaml or merged into it from other local YAML files through include statements. Note: all included build configuration YAML files must have the same format as the base dbb-build.yaml file.

The dbb-build.yaml contains the following top-level elements:

  • include: For the description of the YAML schema, see include:.
  • variables: For the description of the YAML schema, see variables:.
  • lifecycles: For the description of the YAML schema, see lifecycles:.
  • tasks: For the description of the YAML schema, see tasks:.

NOTE: All zBuilder YAML files require a YAML schema version: property. This allows future releases of DBB to add additional zBuilder function and features without "breaking" earlier versions of the DBB zBuilder.

Example of a build configuration file

DBB provides a default dbb-build.yaml build configuration file in the usr/lpp/IBM/dbb/build directory. This build configuration file contains a number of predefined lifecycles and can be used out of the box with little or no configuration required. You can customize the build configuration file by customizing the DBB tasks and even defining your own lifecycles.

Below is an example of a simple build configuration file.

 version: 1.0.0

 # include and merge other YAML configuration files
 include:
   - file: BMS.yaml
   - file: Cobol.yaml
   - file: LinkEdit.yaml

 # global variables available to all build lifecycles and tasks
 variables:
   - name: defaultEncoding
     value: utf-8

 # build lifecycles executable from the DBB CLI
 lifecycles:
   # build all programs for the application
   - lifecycle: full
    
     # define the list of tasks to execute during the build lifecycle
     tasks:
       - Start
       - ScannerInit
       - MetadataInit
       - FullAnalysis
       - Languages   
       - Finish

 # global task configurations that can be referenced in multiple build lifecycles
 tasks:
   # basic build initialization
   - task: Start
  
   # initialize metadata store
   - task: MetadataInit
     variables:
       - name: type
         value: db2
       - name: db2Url
         value: jdbc:db2://system1.company.com:5040/DBB1

   # initialize dependency scanners
   - task: ScannerInit
  
   # create full build list
   - task: FullAnalysis

   # build finalization
   - task: Finish
     variables:
       - name: logEncoding
         value: ${defaultEncoding}
  
   # create a stage to contain a list of reusable tasks
   - stage: Languages
     tasks:
       - BMS            # Defined in BMS.yaml
       - Cobol          # Defined in Cobol.yaml
       - LinkEdit       # Defined in LinkEdit.yaml