Task: zOSConnect

Description

This task executes z/OS® Connect compilation binary files to create RESTful APIs.

Task dependency list

List of tasks that must execute before this task.

  • Start
  • File Analysis

Actions

V2 Configuration

  • Calculate zOSConnect input types for files in the SOURCE_LIST based on configuration properties and directory structure.
  • For each zOSConnect build file, execute the compilation process by using the zCEE2 zconbt binary file in z/OS UNIX and place its resulting artifact(s) in the output directory.
  • If configured, for build files with ARA input types, generate ARA-structured directories and copy build artifacts to them.
  • Add build report records for artifacts by pointing to the directories they were copied to.

V3 Configuration

  • For each src/main/api/openapi.yaml file in the SOURCE_LIST, calculate the path to its project directory.
  • Execute the compilation process by using Gradle in z/OS UNIX.
  • Save the resulting build/libs/api.war file to the output directory.
  • Add build report records for artifacts by pointing to the directories they were copied to.

Syntax

- task: zOSConnect
  comment: String # Message printed to stdout when the task begins executing.
  condition: Boolean # Boolean expression to optionally execute task. Default is true.
  variables: 
    - name: openAPIVersion # The version of OpenAPI to compile APIs with.
      value: Integer # 2 for OpenAPI V2 or 3 for OpenAPI V3. Default 3.
    - name: outputDir # The directory to place build artifacts in.
      value: String # Default ${LOGS}
    - name: outputEncoding # The encoding of build artifacts.
      value: String # Default ${LOG_ENCODING}
    - name: configSources # include patterns that determine which files from the source list will be processed by this task
      value: List(String) # Default includes all files in the source list

V2 Configuration specific variables

NOTE: As a requirement of this version of zOSConnect, you must add your JAVA_HOME /bin directory to your PATH.

variables: 
  - name: zconbtPath # Path to the zconbt binary
    value: String # NOTE: This variable MUST be configured.
  - name: defaultInputType # Default input type used on any file that has none.
    value: String # Default NONE.
  - name: inputType # Sets the input type for all file patterns configured.
    forFiles: String # File patterns
    value: String # Default ${defaultInputType}.
  - name: doPackageAraArtifacts # Package ARA Build artifacts in ARA-specific directories.
    forFiles: String # File patterns
    value: Boolean # Default false.

V3 Configuration specific variables

variables: 
  - name: gradlePath # Path to Gradle executable.
    value: String # Default "/var/gradle/bin/gradle".
  - name: shellEnvironment # Path to a binary to use as environment.
    value: String # Default "bash".
  - name: gradleDebug # Print Gradle-specific debug messages to log files.
    value: Boolean # Default false.

YAML variables

Required variables

Must be defined for the task to execute.

V2 Configuration specific variables

zconbtPath

Type: String
Path to the zconbt binary file in your z/OS® Connect installation. Configure this variable only if you are using OpenAPI V2.

Optional variables

Only need to be defined to change default values.

openAPIVersion

Type: Integer
Default: 3
The version of OpenAPI to compile APIs with. Each version presents a different list of specific configuration variables.

outputDir

Type: String
Default: ${LOGS}
The directory to place build artifacts in.

outputEncoding

Type: String
Default: ${LOG_ENCODING}
The encoding of build artifacts.

V2 Configuration specific variables

defaultInputType

Type: String
Default: NONE
Sets the input type used on any file that does not have one.

inputType

Type: String
Default: ${defaultInputType}
Sets the input type for all file patterns configured in for files.

doPackageAraArtifacts

Type: Boolean
Default: false
Packages ARA Build artifacts in ARA-specific directories.

V3 Configuration specific variables

gradlePath

Type: String
Default: "/var/gradle/bin/gradle"
Path to a Gradle executable program on z/OS UNIX.

shellEnvironment

Type: String
Default: "bash"
Path to a binary file to use as z/OS UNIX environment. Gradle compatibility generally demands this binary be configured as bash.

gradleDebug

Type: Boolean
Default: false
Prints Gradle-specific debug messages to log files.

Build Context (advanced)

In addition to the YAML variables provided by users in the DBB YAML configuration files, some tasks look for inputs and generate outputs to the zBuilder Build Context. The Build Context is a dynamic storage area passed into each task that is being executed by the zBuilder and is used for task-to-task communication.

Build Context inputs

Keyword Type Source Description
LOGS String Start Location to write build log files and default location of the output directory. Set by logOutput YAML variable.
LOG_ENCODING String Start The encoding to write log files in and default encoding of build artifacts. Set by logEncoding YAML variable, which can be overridden by the --log-encoding <encoding> CLI option.
WORKSPACE String zBuilder Used to relativize file paths.

Build Context outputs

None