Build lifecycle
A build lifecycle is a named build definition that defines a specific type of build. It consists of an ordered list of configured tasks that need to run during the build. Lifecycles are executed by using the DBB CLI build command.
#> dbb build full --hlq USER1.BUILD
Pre-defined lifecycles
Lifecycles are generally defined in the dbb-build.yaml
. DBB ships with several pre-defined lifecycles for common z/OS build scenarios.
full
: Builds all the programs (or buildable files) of an application.impact
: Builds only the programs that are impacted by source files that have changed since a previous build.user
: Builds a single program from an IDE such as IBM Developer for z/OS or Wazi for VSCode for debugging and testing.
See Lifecycle samples for the full list of DBB pre-defined lifecycles with explanations on how to configure and use them.
Example of a lifecycle:
lifecycles:
- lifecycle: full
comment: "Building all programs for application ${APPLICATION}"
tasks:
- Start
- MetadataInit
- ScannerInit
- FullAnalysis
- Languages
- Finish
See lifecycles:
in the YAML schema reference.
Custom lifecycles
You can define your own named lifecycles that can be executed by using the build CLI command.
lifecycles:
- lifecycle: cleanup
comment: "Delete stale datasets and topic branch build groups."
# Add additional CLI option to pass in build group name
cli:
usage: dbb build cleanup --hlq <HLQ> --group <buildgroup>
options:
- longOption: "group"
hasArg: true
description: "Metadata build group to delete"
# Reuse existing tasks configuration and declare new tasks
tasks:
# Include the Start task for build process initialization
- Start
# Include the MetadataInit task for metadata store initialization
- MetadataInit
# Declare custom task that deletes datasets
- task: DeleteDatasets
script: groovy/DeleteDatasets.groovy
# Declare custom task that deletes build groups
- task: DeleteBuildGroups
script: groovy/DeleteBuildGroups.groovy
# Include the finish task for build process termination
- Finish
To invoke the cleanup lifecycle use:
# dbb build cleanup --hlq USER1.APP1.NEWFEAT --group App1-NewFeature
IBM Dependency Based Build 3.0.0
BUILD
Lifecycle: cleanup
> Delete stale datasets and topic branch build groups.
Task: Start
. . .