Skip to content

Conversation

@thadbeeraf
Copy link
Contributor

standalone deployment pipeline template for Jenkins

Copy link
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.

@thadbeeraf please take a look to my initial review. FYI @M-DLB

string(name: 'releaseVersion', defaultValue: '', description: 'Release version to deploy (only for release eg: rel-1.6.1 )')
string(name: 'buildId', defaultValue: '', description: 'Build pipeline ID (e.g., 00000018)')
choice(name: 'targetEnvironment', choices: ['integration', 'acceptance', 'production'], description: 'Deployment target environment')
string(name: 'branchName', defaultValue: 'main', description: 'Branch name (e.g., main, feature/test-utility-script)')
Copy link
Member

Choose a reason for hiding this comment

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

We should not need to have the branchName reference here.

The releaseVersion and the branchName mean the same while they are both pointing to the "packageReference".

Please take a look to this documentation at: https://github.com/IBM/dbb/tree/main/Templates/Common-Backend-Scripts#packagebuildoutputssh

string(name: 'buildId', defaultValue: '', description: 'Build pipeline ID (e.g., 00000018)')
choice(name: 'targetEnvironment', choices: ['integration', 'acceptance', 'production'], description: 'Deployment target environment')
string(name: 'branchName', defaultValue: 'main', description: 'Branch name (e.g., main, feature/test-utility-script)')
choice(name: 'pipelineType', choices: ['build', 'release'], description: 'Pipeline type: build or release')
Copy link
Member

Choose a reason for hiding this comment

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

This is rather the "Package Type", that the user wants to deploy.

Description could be like "Package Type - a preliminary build or release candidate"

echo "==============================="
echo "Deployment Pipeline Parameters"
echo "==============================="
echo "[INFO] Application: ${params.application}"
Copy link
Member

Choose a reason for hiding this comment

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

I would re-order this by:

Application, Package Type, Build Id, Target Environment.


This Jenkins pipeline implements the [Git-based process and branching model for mainframe development](https://ibm.github.io/z-devops-acceleration-program/docs/git-branching-model-for-mainframe-dev) and leverages [Common Backend Scripts](https://github.com/IBM/dbb/blob/main/Templates/Common-Backend-Scripts/README.md) along with **IBM Wazi Deploy** to automate deployments of pre-built application packages from an artifact repository into integration, acceptance, and production environments on z/OS.

The pipeline supports **manual or automated triggers** and implements the following stages:
Copy link
Member

Choose a reason for hiding this comment

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

Isn't it just manual?

* **Validate Parameters**
- Validates pipeline input parameters passed during manual trigger or via API.
- Determines the appropriate environment configuration file based on the selected target environment.
- Ensures required parameters (e.g., `application`, `buildId`, `pipelineType`) are defined.
Copy link
Member

Choose a reason for hiding this comment

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

adjust according to above comments about the parameters

| ------------------- | ----------------------------- | ------------------------------------------------------------------------- |
| `application` | Yes | Application name to deploy. |
| `buildId` | Yes | Build pipeline ID corresponding to the artifact. |
| `releaseVersion` | Only for release pipelines | Release version (e.g., `rel-2.6.0`). |
Copy link
Member

Choose a reason for hiding this comment

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

Please update based on earlier comments.

This folder contains templates for standalone deployment pipelines.

Refer to [Deploy_Pipeline/REDME.md](../Deploy_Pipeline/README.md)
Refer to [Gitlab/REDME.md](./Gitlab/README.md)
Copy link
Member

Choose a reason for hiding this comment

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

Can this be probably rather a list?

@M-DLB
Copy link
Member

M-DLB commented Dec 1, 2025

I would suggest restructuring the Templates folders. Right now, each CI orchestrator has its own subfolder, and we've introduced the Deploy_Pipeline subfolder, where we also have subfolder per orchestrator.
My suggestion would be to move the deployment pipeline templates into each orchestrator subfolder, into their own sub-sub-folders.

It would look like this:

Templates
-> Jenkins
   -> CICD (this is where the full pipeline with Build & Deploy is located)
   -> CD (The Deploy on pipeline)
-> Azure
   -> CICD (this is where the full pipeline with Build & Deploy is located)
   -> CD (The Deploy on pipeline)   

Same for GitHub and GitLab (for both z/OS and distributed runners).

What do you think @dennis-behm @thadbeeraf ?

@dennis-behm
Copy link
Member

Thanks for the suggestion @M-DLB . I like the idea, and think this is worth to restructure.

@thadbeeraf
Copy link
Contributor Author

thadbeeraf commented Dec 3, 2025

Okay, I think we can go ahead with the new structure then.
I'll update the PR with changes.

}
}

stage('Generate Plan') {
Copy link
Member

Choose a reason for hiding this comment

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

@thadbeeraf - The stages need a when condition to manage scenarios when a previous stage failed.

Today, they just continue to execute.

Copy link
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.

@thadbeeraf Thank you for continuing on the template. I have a few comments, please see them below.

echo "==============================="
echo "[INFO] Application: ${application}"
echo "[INFO] Package Type: ${PackageType}"
echo "[INFO] Build ID: ${buildId}"
Copy link
Member

Choose a reason for hiding this comment

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

Can we change the order and have Package Reference before the Build ID?

parameters {
string(name: 'application', defaultValue: '', description: 'Application name')
choice(name: 'PackageType', choices: ['build', 'release'], description: 'Package type')
string(name: 'buildId', defaultValue: '', description: 'Build pipeline ID')
Copy link
Member

Choose a reason for hiding this comment

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

Can we switch the order and have packageReference before the buildId, please?

deployOutputDirectory = "${WORKSPACE}/${application}/DEPLOY-OUTPUT"
}

parameters {
Copy link
Member

Choose a reason for hiding this comment

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

In a previous version the description of the input parms were more details. Can we please add that back in?


parameters {
string(name: 'application', defaultValue: '', description: 'Application name')
choice(name: 'PackageType', choices: ['build', 'release'], description: 'Package type')
Copy link
Member

Choose a reason for hiding this comment

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

Please use consistent casing of the variables.

}
}

post {
Copy link
Member

Choose a reason for hiding this comment

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

Please upload the the deployment-report.html. I don't see this happening when testing the template -

It's generated here:
image

But the archive step is not there:
image

I think it needs to use ${uniqueWorkspaceId} instead of ${WORKSPACE}

echo "[INFO] Generating deployment report"

def evidenceCmd = "wazideploy-evidence.sh -w ${uniqueWorkspaceId} -l ${wdEvidencePath}/evidence.yaml -o deploy/deployment-report.html"
sh evidenceCmd
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to separate this into two stages:

  1. It's the report of the current deployment (and btw line 152 requires some error handling)
  2. It's storing the the yaml file to the shared evidence folder.

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.

3 participants