Skip to content

Feature/301 create utility scripts to compute the next release build for cbs#310

Merged
dennis-behm merged 162 commits intoIBM:mainfrom
monvora:feature/301-create-utility-scripts-to-compute-the-next-release-build-for-CBS
May 20, 2025
Merged

Feature/301 create utility scripts to compute the next release build for cbs#310
dennis-behm merged 162 commits intoIBM:mainfrom
monvora:feature/301-create-utility-scripts-to-compute-the-next-release-build-for-CBS

Conversation

@monvora
Copy link
Copy Markdown
Member

@monvora monvora commented Apr 11, 2025

  • Add shell script to compute the next release version: computeReleaseVersion.sh
  • Add Jenkins pipeline definition template that perform deployment through Wazi Deploy

dennis-behm and others added 30 commits January 30, 2025 10:47
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Co-authored-by: Mathieu Dalbin <mathieu.dalbin@fr.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
Signed-off-by: Dennis Behm <dennis.behm@de.ibm.com>
…utility-scripts-to-compute-the-next-release-build-for-CBS
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.

@monvora can you please address:

  • permission bits - a lot got changed (I assume unintentionally)
  • update the README that this new script is available
  • minor comment.

The updates of the pipeline template should be planned in dedicated pull requests that are already captured in #311

export mainBranchSegment=`echo ${Branch} | awk -F "/" '{ print $1 }'`
export secondBranchSegment=`echo ${Branch} | awk -F "/" '{ print $2 }'`
export thirdBranchSegment=`echo ${Branch} | awk -F "/" '{ print $3 }'`
echo $PGM": [INFO] Branch segments: ${mainBranchSegment}, ${secondBranchSegment}, ${thirdBranchSegment}"
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 we can remove this print. It is a big confusing.
Maybe put it into a comment and add a comment that this is for debugging.

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.

Thank you @dennis-behm for a review. I made all the changes we discussed. Now the PR contains:

  • computeReleaseVersion.sh script to compute the next release version.
  • Updated readme.md which documented about computeReleaseVersion.sh

Please have another reveiw.

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.

@monvora - can you please add a section to the README about this new script, please?

…nor update to the computeReleaseVersion.sh script based on Dennis's feedback
@monvora
Copy link
Copy Markdown
Member Author

monvora commented Apr 29, 2025

@monvora - can you please add a section to the README about this new script, please?

Done...

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.

@monvora Thanks for the documentation updates. I tested your script and this caused a set of new ideas. Can you please check my comments below?

Comment thread Templates/Common-Backend-Scripts/computeReleaseVersion.sh
Comment thread Templates/Common-Backend-Scripts/computeReleaseVersion.sh
echo $PGM": [INFO] Baseline reference: ${baselineRef}"

computeNextReleaseVersion
export releaseVersion="rel-"${newVersion}
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.

Please check if newVersion was computed - basically if it is "set" like the other environment variables. If the variable is empty, set RC=8.

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.

Done...

[dbbBuild.sh](dbbBuild.sh) | Pipeline Shell Script to invoke the Dependency Based Build framework [zAppBuild](https://github.com/IBM/dbb-zappbuild) | [script details](#dbbbuildsh-for-zappbuild-frameworkh)
[zBuilder.sh](zBuilder.sh) | Pipeline Shell script to invoke the zBuilder framework [zBuilder](https://www.ibm.com/docs/en/dbb/3.0?topic=building-zos-applications-zbuilder) | [script details](#zbuildersh-for-dbb-zbuilder)
[zBuilder.sh](zBuilder.sh) | Pipeline Shell Script to invoke the zBuilder framework [zBuilder](https://www.ibm.com/docs/en/dbb/3.0?topic=building-zos-applications-zbuilder) | [script details](#zbuildersh-for-dbb-zbuilder)
[computeReleaseVersion.sh](computeReleaseVersion.sh) | Pipeline Shell Script to compute the next release version based on the baseline version information stored in the [baselineReference.config](samples/baselineReference.config) file. | [script details](#computeReleaseVersionsh)
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.

Suggested change
[computeReleaseVersion.sh](computeReleaseVersion.sh) | Pipeline Shell Script to compute the next release version based on the baseline version information stored in the [baselineReference.config](samples/baselineReference.config) file. | [script details](#computeReleaseVersionsh)
[computeReleaseVersion.sh](computeReleaseVersion.sh) | Pipeline Shell Script to compute the next release version based on the baseline version information stored in the application's [baselineReference.config](samples/baselineReference.config) file. | [script details](#computeReleaseVersionsh)

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.

Done.

Comment thread Templates/Common-Backend-Scripts/README.md
getBaselineReference
if [ $rc -eq 0 ]; then
ERRMSG=$PGM": [INFO] Baseline reference: ${baselineRef}"
eecho $ERRMSG
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.

Suggested change
eecho $ERRMSG
echo $ERRMSG

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.

Done and tested

;;
*)
rc=8
ERRMSG=$PGM": [ERROR] Release type can only be Major, Minor or Patch. rc="$rc
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.

Suggested change
ERRMSG=$PGM": [ERROR] Release type can only be Major, Minor or Patch. rc="$rc
ERRMSG=$PGM": [ERROR] No valid release type found. Valid release types are 'major', 'minor' or 'patch'. rc="$rc

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.

Done

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.

@monvora I have a few more comments. Please see below. Thank you.

echo $ERRMSG
fi

tmp2=$(echo $ReleaseType | tr '[:upper:]' '[:lower:]')
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 section could lead to a wrong behaviour. We should not set a default.

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.

Done

Comment thread Templates/Common-Backend-Scripts/computeReleaseVersion.sh
ERRMSG=$PGM": [INFO] Compute the next release version complete. The next release version: ${releaseVersion}. rc="$rc
echo $ERRMSG
else
ERRMSG=$PGM": [ERROR] Compute the next release version failed. Check Console for details. rc="$rc
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.

Suggested change
ERRMSG=$PGM": [ERROR] Compute the next release version failed. Check Console for details. rc="$rc
ERRMSG=$PGM": [ERROR] Compute the next release version failed. Check console for details. rc="$rc

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.

Done

Comment thread Templates/Common-Backend-Scripts/computeReleaseVersion.sh
@dennis-behm dennis-behm linked an issue May 2, 2025 that may be closed by this pull request
Comment thread Templates/Common-Backend-Scripts/README.md
Comment thread Templates/Common-Backend-Scripts/README.md
Comment thread Templates/Common-Backend-Scripts/README.md
Copy link
Copy Markdown
Member

@M-DLB M-DLB left a comment

Choose a reason for hiding this comment

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

A few comments


# internal veriables
PGM=$(basename "$0")
PGMVERS="1.10"
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.

Suggested change
PGMVERS="1.10"
PGMVERS="1.00"

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.

Done

echo " -r <releaseType> - Type of the release "
echo " to calculate the version. "
echo " Accepted values: "
echo " - Major "
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.

Are there any checking of the case for this parm? The README says "major, minor, patch" but here it says it's "Major, Minor, Patch".

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.

OK I've seen the translation below to all lowercase, but for consistency, it would be better to have the same values everywhere.

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.

Updated value in the computeReleaseVersion.sh file to "major", "minor" and "patch".

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.

Thank you for this important script, @monvora .

@dennis-behm dennis-behm merged commit c48cecf into IBM:main May 20, 2025
1 check failed
@monvora monvora deleted the feature/301-create-utility-scripts-to-compute-the-next-release-build-for-CBS branch May 30, 2025 07:34
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.

Create utility scripts to compute the next release build for CBS

3 participants