Skip to content

Update JenkinsfileWithWaziDeploy with various changes#394

Open
fritze2 wants to merge 10 commits into
IBM:mainfrom
fritze2:updateJenkinsfileWithWaziDeploy
Open

Update JenkinsfileWithWaziDeploy with various changes#394
fritze2 wants to merge 10 commits into
IBM:mainfrom
fritze2:updateJenkinsfileWithWaziDeploy

Conversation

@fritze2
Copy link
Copy Markdown
Member

@fritze2 fritze2 commented Mar 28, 2026

The changes in this pipeline have been tested in the SMPO lab environment.

  • Switch Build stage from using zAppBuild to zBuilder framework by calling the common backend script zBuilder.sh.
  • Add required argument -i ${PackageTarPath} to the common backend scripts wazideploy-generate.sh and wazideploy-deploy.sh.
  • Fix broken link on line 5 to https://ibm.github.io/z-devops-acceleration-program/docs/branching/git-branching-model-for-mainframe-dev.
  • Change formatting to more easily differentiate between sections for pipeline variables.
  • Update pipeline variables sections:
    • Change value of JenkinsAgent to a more generic agent named ZosAgent.
    • Rename pipeverbose to verbose.
    • Rename zAppBuildVerbose to zBuilderVerbose.
    • Add definitions for AppBranch, BuildDir, and Branch. This is in case the user creates a generic pipeline using a single-branch instead of a multi-branch pipeline, so the variables will not be null.
    • Create new variables: DbbCommunityRepo to be configured by the user to point to the installed DBB community repository and DbbPipelineScripts.
    • Change value of WdEnvFileIntegration to point to environment located in the DBB community repository.
    • Create a branchConfig map to replace the series of if conditions that configure branch behavior.
  • Allow deployment from branches with "RELEASE" prefix.
  • Switch to addSummary DSL from deprecated createSummary DSL.
  • Add addWarningBadge and addErrorBadge DSLs on a build issue.
  • Wrap DSL calls in dslMethodExists so they don't fail the build.

@fritze2 fritze2 force-pushed the updateJenkinsfileWithWaziDeploy branch from 7f75acf to f6f75ab Compare March 28, 2026 15:14
@fritze2
Copy link
Copy Markdown
Member Author

fritze2 commented Mar 30, 2026

Hello DBB maintainers, I discovered that there is a similar PR made by Kenny for the IDD Jenkinsfile. I will synchronize my PR with the improvements made in #377 and address the comments Dennis made. I will also break apart the PR into multiple commits to make it easier to review.

@fritze2 fritze2 force-pushed the updateJenkinsfileWithWaziDeploy branch from f6f75ab to 436cc55 Compare April 3, 2026 15:18
fritze2 added 9 commits April 3, 2026 11:19
Signed-off-by: ETHAN FRITZ <erfritz@us.ibm.com>
Signed-off-by: ETHAN FRITZ <erfritz@us.ibm.com>
Signed-off-by: ETHAN FRITZ <erfritz@us.ibm.com>
Signed-off-by: ETHAN FRITZ <erfritz@us.ibm.com>
Signed-off-by: ETHAN FRITZ <erfritz@us.ibm.com>
Signed-off-by: ETHAN FRITZ <erfritz@us.ibm.com>
Signed-off-by: ETHAN FRITZ <erfritz@us.ibm.com>
Signed-off-by: ETHAN FRITZ <erfritz@us.ibm.com>
Signed-off-by: ETHAN FRITZ <erfritz@us.ibm.com>
@fritze2 fritze2 force-pushed the updateJenkinsfileWithWaziDeploy branch from 436cc55 to 2fdc6cd Compare April 3, 2026 15:19
@fritze2
Copy link
Copy Markdown
Member Author

fritze2 commented Apr 3, 2026

I am done making changes and this can be reviewed.

Copy link
Copy Markdown
Member

@dennis-behm dennis-behm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fritze2 Thanks for the effort to uplift the Jenkins template! Great work. I have identified a couple of areas, which I would like you to another look at. Feel free to reach out to me directly as well, if you want to discuss those

Comment thread Templates/JenkinsPipeline/JenkinsfileWithWaziDeploy Outdated
// DbbPipelineScripts - Path to the DBB Common-Backend-Scripts directory.
def zBuilderVerbose = ""
def DbbDoBuild = true
def DbbCommunityRepo = "/u/user/dbb"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather a comment/idea - would it be beneficial to inherit this as environment variables defined via the Jenkins agent?

When building the project on a different build machine (via a different agent), where the tools are installed at a different location, the user would need to update the Jenkinsfile

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, it makes sense for DbbCommunityRepo to be an environment variable, and perhaps it could have a default to something set in the Jenkinsfile. I'll update that.

BuildCmd = "${DbbPipelineScripts}/zBuilder.sh -w ${WORKSPACE} -a ${AppName} -b ${AppBranch} -p ${PipelineType} -q ${AppHLQ} ${zBuilderVerbose}"
println("${PipelineName}[INFO]: Build Command = ${BuildCmd}")

dir("${WORKSPACE}/${AppName}") {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the need to change into the app directory. I think this can be removed.

if (verbose) {
sh "echo ${PipelineName}[DEBUG]: Build Return Code = ${Buildrc}"
}
BuildOutputDir = "${WORKSPACE}/${AppName}/logs"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The zBuilder.sh script copies at the end of the process the log files from the logs directory in the application repository folder into ${WORKSPACE}/logs. Let's use this location to pick up the log files.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to define the BuildOutputDir in the variables section of the pipeline. I noticed, that it is referenced at multiple places.

It should be ${WORKSPACE}/logs

// AppName - Name of the Application folder within the application repository.
// AppHLQ - Build destination High-Level Qualifier for any pipeline.
def AppBranch = ""
def BuildDir = ""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is obsolete, while you are referencing ${WORKSPACE} instead.

autoCancelled = false

// Find the package tar file to use as input for Wazi Deploy stages.
dir("${WORKSPACE}/logs") {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Picking on this, but it should be across the entire template -
instead of ${WORKSPACE}/logs use the ${BuildOutputDir}


// Find the package tar file to use as input for Wazi Deploy stages.
dir("${WORKSPACE}/logs") {
def tarFiles = findFiles(glob: "build-*.tar")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a need to validate if a tar file exists. Did you encounter an issue in this area? packageBuildOutputs.sh is supposed to end with a proper return code for successful completion or failure.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't so much a need to validate the tar file exists as it is that we need the name of the tar file, and it contains a dynamic timestamp value, in order to pass it as input -i into wazideploy-generate.sh later here.
I may have misunderstood how to pass the tar file into the wazideploy-generate.sh.

if (autoCancelled == false) {
WdGenDeployPlanCmd = "${DbbPipelineScripts}/wazideploy-generate.sh -w ${WORKSPACE} -a ${AppName} -P ${PipelineType} -R ${ReleaseVersion} -I ${BuildNumber} -i ${PackageTarPath}"

dir("${WORKSPACE}") {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dir seems not to be needed here to run the command

WdDeployCmd = ""
MsgHdr = "Deploy Integration Step:"

WdDeployCmd = "${DbbPipelineScripts}/wazideploy-deploy.sh -w ${WORKSPACE} -e ${WdEnvFileIntegration} -i ${PackageTarPath} -l deploy/evidences/evidence.yaml"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-i ${PackageTarPath}is not needed here, while the CBS work out of the assumptions and conventions where to store the package from the generate step. Let's catch up if you see this as a requirement.

echo "[ERROR]: Command execution failed: ${e.message}"
// More robust error code extraction
def errorMsg = e.toString()
if (errorMsg.contains('script returned exit code')) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see where the scripts print a message like script returned exit code. Can you elaborate why you added this, please?

Co-authored-by: Dennis Behm <dennis.behm@de.ibm.com>
@fritze2
Copy link
Copy Markdown
Member Author

fritze2 commented May 7, 2026

I am implementing the changes and re-running a test pipeline on our lab environment. I'll request another review once I have all the changes working and committed. Thanks, Dennis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants