zAppBuild is a free, generic mainframe application build framework that customers can extend to meet their DevOps needs. It is available under the Apache 2.0 license, and is a sample to get you started with building Git-based source code on z/OS UNIX System Services (z/OS UNIX). It is made up of property files to configure the build behavior, and Groovy scripts that invoke the DBB toolkit APIs.
Build properties can span across all applications (enterprise-level), one application (application-level), or individual programs. Properties that cross all applications are managed by administrators and define enterprise-wide settings such as the PDS name of the compiler, data set allocation attributes, and more. Application- and program-level properties are typically managed within the application repository itself.
The zAppBuild framework is invoked either by a developer using the "User Build" capability in their integrated development environment (IDE), or by an automated CI/CD pipeline. It supports different build types.
The main script of zAppBuild, build.groovy, initializes the build environment, identifies what to build, and invokes language scripts. This triggers the utilities and DBB APIs to then produce runtime artifacts. The build process also creates logs and an artifact manifest (BuildReport.json) for deployment processes coordinated by the deployment manager.
The following chart provides a high-level summary of the steps that zAppBuild performs during a build:
The zAppBuild framework is split into two parts. The core build framework, called dbb-zappbuild, is a Git repository that contains the build scripts and stores enterprise-level settings. Your organization's copy of dbb-zappbuild should reside in a permanent location on your z/OS UNIX file system (in addition to your organization's central Git repository). It is typically owned and controlled by the central build team.
The other part of zAppBuild is the application-conf folder that resides within each application repository to provide application-level settings to the central build framework. These settings are owned, maintained, and updated by the application team.
build-confcontains the following enterprise-level property files:build.propertiesdefines DBB initilization properties, including location of the DBB metadata store (for storing dependency information) and more.dataset.propertiesdescribes system datasets such as the PDS name of the COBOL compiler or libraries used for the subsystem. You must update this properties file with your site’s data set names.- Several language-specific property files that define the compiler or link-editor/binder program names, system libraries, and general system-level properties for COBOL, Assembler, and other languages.
languagescontains Groovy scripts used to build programs. For example,Cobol.groovyis called bybuild.groovyto compile the COBOL source codes. The application source code is mapped by its file extension to the language script inapplication-conf/file.properties.samplescontains anapplication-conftemplate folder and a reference sample application, MortgageApplication.utilitiescontains helper scripts used bybuild.groovyand other scripts to calculate the build list.build.groovyis the main build script of zAppBuild. It takes several required command line parameters to customize the build process.
This folder is located within the application's repository, and defines application-level properties such as the following:
application.propertiesdefines various directory rules, default Git branch, impact resolution rules such as the copybook lookup rules, and more.file.propertiesmaps files to the language scripts indbb-zappbuild/languages, and provides file-level property overrides.- Property files for further customization of the language script processing. For example,
Cobol.propertiesis one of the language properties files to define compiler and link-edit options, among other properties.
The following diagram illustrates how zAppBuild's application- and enterprise-level configurations feed into its build scripts to generate build artifacts from an application repository:

This IBM dbb-zappbuild repository is available for you to clone as a starting template for your organization's dbb-zappbuild. You can then customize and configure your copy of this central build framework as needed. More information on how to do this is detailed in the following section, Making zAppBuild available in your Git provider.
The IBM dbb-zappbuild repository also includes a sample application-conf folder template that you can copy into each of your applications' Git repositories and customize. Additionally, the MortgageApplication sample application is included in this IBM dbb-zappbuild repository with its own customized application-conf folder as an example of an application configured to be built by zAppBuild.
- Note: Although the MortgageApplication example is located inside IBM's
dbb-zappbuildrepository, this is only to make it easier and more convenient to find as a sample. For real-world implementations, applications should reside in their own Git repositories, separate from your organization'sdbb-zappbuildrepository.
Before you start your customization of zAppBuild, you must first create a clone of IBM's zAppBuild repository and store the clone in your Git provider of choice. This could be any Git provider, such as GitHub, GitLab, Bitbucket or Azure Repos, and so on. If you have done this already, feel free to move to the next section.
Here are the steps to make the zAppBuild repository available in a central repository on your Git provider:
- On your local workstation, use your browser and log on to your Git provider. Follow the instructions in your Git provider to create a new repository, which will be the new home of your customized version of zAppBuild.
- We suggest dbb-zappbuild as the new repository/project name, but you can use another name if you prefer.
- Set the repository's visibility according to your needs.
- Do not initialize the repository yet.
- Your Git provider creates the repository, but it is not yet initialized. On most Git providers, the repository creation process ends on a page with information on how to share an existing Git repository. Leave the browser open.
- Clone IBM's public zAppBuild repository to your local workstation. You can use your local workstation's terminal to complete this step (for example, Git Bash in Windows, or Terminal on MacOS).
- If you are using IBM Developer for z/OS (IDz) on VS Code as your IDE, you can use its Terminal. IDz on Eclipse also has a similar Shell view. (We documented the steps in this guide using a terminal.)
-
In the terminal, navigate to the folder where you would like to clone the repository.
-
Retrieve the Git repository URL or SSH path from IBM's public zAppBuild repository:
-
In your terminal, enter the command for cloning the repository. (The following command uses the Git repository URL, but the SSH path can also be used if you have SSH keys set up.):
git clone https://github.com/IBM/dbb-zappbuild.git
- Follow the instructions of your Git provider to push the contents of your newly-cloned local repository (from Step 2) to the central repository on your Git provider (created in Step 1). (Note: Exact instructions may vary from Git provider to Git provider.)
-
Within the terminal session, execute the following commands to push an existing Git repository:
- Replace
<existing_repo>with the path to your newly-cloned local repository. - Replace
<Your central Git repository>with the URL to the new central repository on your Git provider. (For example, with GitLab as the Git provider, the URL might look similar togit@gitlab.dat.ibm.com:DAT/dbb-zappbuild.git.)
cd <existing_repo> git remote rename origin old-origin git remote add origin <Your central Git repository> git push -u origin –all git push -u origin --tags
- Replace
-
On the Git provider's webpage for your new central repository in the browser, you will find that the repository is now populated with all of zAppBuild's files and history, just like on IBM's public zAppBuild repository.
-
Once you have a clone of zAppBuild in your Git provider, you can customize the properties and scripts within it according to your organization's needs. The zAppBuild wiki documents some possible zAppBuild customization scenarios. Additionally, IBM regularly releases new versions of the official zAppBuild repository to deliver enhancements and bug fixes. To integrate the latest official zAppBuild updates into your customized version of zAppBuild, you can use the following process:
- Locate the internal Git repository and create a new Git branch. This is a good practice to validate the changes first. In this example, the new branch is called
update-zappbuild. - Add a new Git remote definition to connect to IBM's official public zAppBuild GitHub repository. (Note: This step requires internet connectivity.)
-
First, list the remotes by issuing
git remote -v:- For more on Git remotes, see the git-remote documentation.
-
Add a new remote named
zappbuild-officialto connect to GitHub by issuing the following command:git remote add zappbuild-official https://github.com/IBM/dbb-zappbuild.git
-
Verify that the new remote is available by issuing the command to list the remotes again:
git remote -v: -
Fetch the latest information from the official repository, by executing a Git fetch for the official dbb-zappubuild repository:
git fetch zappbuild-official
-
Make sure that your feature branch is checked out, before attempting to merge the changes from zappbuild-official. To merge the changes run into your branch
update-zappbuild, run the following command:git merge zappbuild-official/main
Potentially, you face merge conflicts. In the above case, the merge processor could not automatically resolve the
utilities/ImpactUtilities.groovy.Run the command
git statusto see which files changed: -
Open the unmerged files and resolve them manually. Either use the terminal, or an IDE for this task.
The Git integration in many modern IDEs (for example, VS Code) is able to provide a side-by-side comparison highlighting the diff between your feature branch and the incoming changes from the merge attempt (in this case, from
zappbuild-official). This can help make manual resolution of any merge conflicts much easier. -
Commit the changes and verify them with a sample application before committing it (or opening a pull request to commit it) to your main branch that is used for all your production DBB builds.
-








