Task: Package
Description
This task creates deployment packages that contain build outputs and a manifest file. The task copies built artifacts from the build list into a .tar archive package for deployment. It records artifact and source metadata in the
embedded Wazi Deploy manifest file.
Note: The Package task requires build maps to be enabled. Build maps are enabled by default in DBB 3.0.4 and later. Build maps can be disabled globally by using the disableBuildMaps variable in the
MetadataInit task configuration, but this prevents the Package task from running.
What gets packaged
The Package task packages deployable outputs that are created during the Languages stage of the build. Any deployable build output is a candidate for packaging. An artifact is considered a deployable
output when the step (or DD statement) that creates it is marked as an output and assigned a deployType value.
Step-level outputs
When a build step includes a deployType attribute, the step output is implicitly marked as deployable:
- step: copyJCL
type: copy
condition: ${FILE_EXT} == "jcl"
target: //'${HLQ}.JCL(${MEMBER})'
copyMode: TEXT
deployType: JCL
In this example from the Transfer.yaml language sample, the copyJCL step copies JCL files and marks them with deployType: JCL, making them candidates for packaging.
DD statement outputs
For MVS steps that use DD statements, outputs must be explicitly marked with both output: true and a deployType:
- step: linkEdit
type: mvs
pgm: IEWBLINK
dds:
- { name: "SYSLIN", dsn: "${HLQ}.OBJ(${ENTRY})", options: "shr" }
- { name: "SYSLMOD", dsn: "${HLQ}.LOAD(${ENTRY})", options: "shr",
output: true, deployType: "LOAD", scan: "${scanLoadModule}" }
In this LinkEdit example, the SYSLMOD DD statement is marked with output: true and deployType: "LOAD", making the generated load module a candidate for packaging. The SYSLIN DD (input object deck) is not marked as an output and will not be packaged.
See also Copy mode mappings and Wazi Deploy manifest for other configuration tasks.
Usage examples
Pipeline lifecycle sample
DBB 3.0.4 includes a sample Pipeline lifecycle in the dbb-build.yaml file. This lifecycle demonstrates how to use the Package task for incremental builds and packaging.
It defines CLI parameters to control package versioning and runs the Package task after building impacted files.
Pipeline lifecycle definition:
- lifecycle: pipeline
cli:
usage: dbb build pipeline [arguments] [options]
options:
- longOption: "release-id"
hasArg: true
description: "The release identifier for the package being created. ie: 1.0.0"
- longOption: "build-id"
hasArg: true
description: "The build identifier for the package being created. ie: 20240415.7"
tasks:
- Start
- ScannerInit
- MetadataInit
- ImpactAnalysis
- Languages # Defined in Languages.yaml
- Package
- Finish
Key points:
- The
--release-idand--build-idCLI parameters are parsed by theStarttask and added to the build context asRELEASE_IDENTIFIERandBUILD_IDENTIFIER. BUILD_IDENTIFIERdefaults to the build start timestamp (withTIME_FORMAT) if it is not provided.RELEASE_IDENTIFIERis added to the context only if the--release-idCLI argument is provided.- The
Packagetask runs after theLanguagesstage because it requires build artifacts and build map metadata be generated during the language-specific build steps. - The
Packagetask typically includes a condition to skip on build errors or preview mode.
Task dependency list
The task depends on context variables that are exported by the Start and MetadataInit tasks. Additionally, it must run after the Languages task to ensure all build outputs are available and build map metadata
has been refreshed.
StartMetadataInitLanguageTask
Actions
- Validates that build maps are not disabled globally (required for packaging).
- Retrieves the build list populated by
Languagetasks. This list contains all successfully built source files. - Processes each build map to extract output artifacts and their metadata.
- Copies build outputs (from PDS members or z/OS UNIX files) to a temporary package directory structure.
- Calculates SHA-256 hashes for each packaged artifact.
- Populates SCM information from source repositories that are involved in building the artifacts.
- Records dependency metadata for each artifact based on build map inputs and binary inputs.
- Processes deleted artifacts from deleted build maps (for incremental deployments).
- Generates a Wazi Deploy manifest YAML file (
wazideploy_manifest.yml) that contains artifact metadata. - Creates a
.tararchive of the package directory. - Writes the package to the output directory (defaults to
LOGSdirectory).
Package structure
The Package task creates a structured deployment package with the following directory layout:
<application>-<version>.tar
├── wazideploy_manifest.yml # Wazi Deploy manifest file
├── bin/ # PDS-based outputs
│ ├── load/ # LOAD modules
│ ├── dbrm/ # Database Request Modules
│ ├── obj/ # Object decks
│ └── <deployType>/ # Other deploy types
└── uss/ # z/OS UNIX file outputs
├── jcl/ # JCL files
└── <deployType>/ # Other deploy types
Each artifact in the package includes:
- The build output file
- Metadata in the manifest (name, type, hash, properties, and dependencies)
Copy mode mappings
The Package task uses DBB CopyMode settings to determine how to copy PDS members to the package directory. Different deploy types require different copy modes to preserve the correct data format.
Default copy mode mappings
The task provides default mappings for common z/OS deploy types:
| Deploy Type | DBB CopyMode | Description |
|---|---|---|
| LOAD | LOAD | Load modules |
| CICSLOAD | LOAD | CICS load modules |
| IMSLOAD | LOAD | IMS load modules |
| MAPLOAD | LOAD | BMS map load modules |
| OBJ | BINARY | Object files |
| DBRM | BINARY | Database request modules |
| EQALANGX | VB_BINARY | Variable-blocked binary file |
| COPY | TEXT | Copybooks |
| MAPCOPY | TEXT | BMS map copybooks |
| JCL | TEXT | JCL files |
| PROC | TEXT | Procedures |
| CNTL | TEXT | Control files |
| REXX | TEXT | REXX scripts |
Custom copy mode mappings
You can override or extend the default mappings by using the copyModeMappings task variable:
variables:
- name: copyModeMappings
value:
- deployType: CUSTOM
copyMode: BINARY
- deployType: LOAD
copyMode: LOAD # Override default
The valid DBB CopyMode values are BINARY, LOAD, TEXT, and VB_BINARY.
Wazi Deploy manifest
The Package task generates a Wazi Deploy application manifest file (named wazideploy_manifest.yml) at the root of the package. This file conforms to the Wazi Deploy manifest schema.
For complete details on the manifest structure, schema, and examples, see the Wazi Deploy application manifest file documentation.
The manifest contains the following sections:
Metadata section
- Application name and version
- Build identifier and timestamp
- SCM information (Git repository, branch, commit hash)
- Package description
Artifacts section
Each artifact entry includes the following elements:
- name: Artifact name (member name, file name, or dataset name)
- type: Deploy type (such as LOAD, DBRM, or COPY)
- hash: SHA-256 hash of the artifact file
- description: Source file that produced this artifact
- properties: Additional metadata (custom from DBB)
path: Relative path within the packagegithash: Git commit hash of the source filegiturl: Git repository URLdependency_set: List of dependencies (copybooks, includes, link inputs)
Deleted artifacts section
For incremental builds, the manifest includes a deleted_artifacts section that lists the artifacts that a deployment engine is to remove from the target environment.
Excluding deploy types
You can exclude specific deploy types from packaging by using the excludedDeployTypes variable. This is useful when certain outputs are not to be deployed:
variables:
- name: excludedDeployTypes
value:
- OBJ # Exclude any generated object decks marked as outputs
- UNIT-TESTCASE # Exclude unit testcase programs marked as outputss
Syntax
- task: Package
comment: String # Message printed to stdout when the task begins executing.
condition: Boolean # Boolean expression to optionally execute task. Default is true.
variables:
- name: copyModeMappings # List of deploy type to DBB CopyMode mappings
value: # Default - See copy mode mappings above.
- deployType: String # Deploy type name (e.g., LOAD, DBRM, COPY)
copyMode: String # DBB CopyMode: BINARY, LOAD, TEXT, or VB_BINARY
- name: excludedDeployTypes # List of deploy types to exclude from packaging
value: [String] # Default is NONE.
- name: outputDir # Directory where the tar package file is written
value: String # Default is ${LOGS} directory.
Task variables
Required variables
Must be defined for the task to execute.
None
All required inputs come from the build context, not task configuration.
Optional variables
Only need to be defined to change default values.
copyModeMappings
Type: List<Map>
Default: See Copy mode mappings above
List of mappings between deploy types and DBB CopyMode values. Each mapping contains the following elements:
deployType: The deploy type string (such as "LOAD" or "DBRM")copyMode: The DBBCopyModevalue ("BINARY", "LOAD", "TEXT", or "VB_BINARY")
Custom mappings are merged with defaults. You can then override or add deploy types.
variables:
- name: copyModeMappings
value:
- deployType: MYLOAD
copyMode: LOAD
- deployType: MYTEXT
copyMode: TEXT
excludedDeployTypes
Type: List<String>
Default: NONE
List of deploy type names to exclude from the package. Deploy types are case-insensitive.
variables:
- name: excludedDeployTypes
value:
- OBJ
- EQALANGX
outputDir
Type: String
Default: ${LOGS}
The directory where the .tar package file will be written. If this directory is not specified, the package is written to the LOGS directory.
variables:
- name: outputDir
value: /u/packages/releases
Build Context (advanced)
In addition to the task variables provided by users in the DBB YAML configuration files, some tasks require inputs and generate outputs to the zBuilder Build Context. The Build Context is a dynamic storage area passed into each task being executed by the zBuilder and is used for task-to-task communication.
Build Context inputs
| Keyword | Type | Source | Description |
|---|---|---|---|
START_TIME |
Date | Start | Build start timestamp used in package metadata. |
TIME_FORMAT |
String | Start | Time format string for formatting timestamps. |
WORKSPACE |
String | zBuilder | Workspace directory path used to define relative file paths. |
LOGS |
String | Start | Logs directory path, default location for package output. |
APPLICATION |
String | Start | Application name used in package naming and manifest. |
BUILD_GROUP |
BuildGroup | MetadataInit | Build group that contains build maps for all built files. |
BUILD_LIST |
Set<String> | LanguageTasks | List of successfully built source files to package. |
BUILD_IDENTIFIER |
String | Start | Build ID used in package version. Parsed from --build-id CLI argument. Defaults to build start timestamp (with TIME_FORMAT) if not provided. |
RELEASE_IDENTIFIER |
String | Start | Optional release ID used in package version. Parsed from --release-id CLI argument. Only added to the context by the Start task if the CLI argument is provided. |
DELETED_BUILD_MAPS |
List<BuildMap> | Analysis tasks | Build maps for deleted orrenamed files (for incremental packaging). |
Build Context outputs
| Keyword | Type | Description |
|---|---|---|
| None |
|
The Package task does not export variables to the build context. It produces a .tar file as its output artifact. |
Package naming convention
The Package task generates .tar files by using the following naming convention:
<application>-<version>.tar
Where:
<application>is the application name from the build context<version>is:<releaseId>-<buildId>if a release identifier is provided<buildId>if no release identifier is provided
Example: MyApp-1.0.0-20260114.164500.tar
Error handling
The Package task fails in the following cases:
- Build maps are disabled globally (with the
MetadataInitdisableBuildMapsconfiguration variable) - A build map is missing for a file in the build list
- A deploy type has no corresponding copy mode mapping
- An artifact copy operation fails
- Hash calculation fails for an artifact
- The
.tararchive creation fails
If no artifact is built or deleted, the task skips package generation and returns with a warning message.