-
Notifications
You must be signed in to change notification settings - Fork 146
standalone deployment pipeline for Jenkins #376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
dennis-behm
left a comment
There was a problem hiding this 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)') |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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}" |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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`). | |
There was a problem hiding this comment.
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.
Templates/Deploy_Pipeline/README.md
Outdated
| 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) |
There was a problem hiding this comment.
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?
Co-authored-by: Dennis Behm <[email protected]>
|
I would suggest restructuring the Templates folders. Right now, each CI orchestrator has its own subfolder, and we've introduced the It would look like this: Same for GitHub and GitLab (for both z/OS and distributed runners). What do you think @dennis-behm @thadbeeraf ? |
|
Thanks for the suggestion @M-DLB . I like the idea, and think this is worth to restructure. |
|
Okay, I think we can go ahead with the new structure then. |
8bf6517 to
fb62a5e
Compare
| } | ||
| } | ||
|
|
||
| stage('Generate Plan') { |
There was a problem hiding this comment.
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.
dennis-behm
left a comment
There was a problem hiding this 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}" |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| echo "[INFO] Generating deployment report" | ||
|
|
||
| def evidenceCmd = "wazideploy-evidence.sh -w ${uniqueWorkspaceId} -l ${wdEvidencePath}/evidence.yaml -o deploy/deployment-report.html" | ||
| sh evidenceCmd |
There was a problem hiding this comment.
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:
- It's the report of the current deployment (and btw line 152 requires some error handling)
- It's storing the the yaml file to the shared evidence folder.
Co-authored-by: Dennis Behm <[email protected]>


standalone deployment pipeline template for Jenkins