Feature/301 create utility scripts to compute the next release build for cbs#310
Conversation
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
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>
…utility-scripts-to-compute-the-next-release-build-for-CBS
| 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}" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
dennis-behm
left a comment
There was a problem hiding this comment.
@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
Done... |
dennis-behm
left a comment
There was a problem hiding this comment.
@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?
| echo $PGM": [INFO] Baseline reference: ${baselineRef}" | ||
|
|
||
| computeNextReleaseVersion | ||
| export releaseVersion="rel-"${newVersion} |
There was a problem hiding this comment.
Please check if newVersion was computed - basically if it is "set" like the other environment variables. If the variable is empty, set RC=8.
| [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) |
There was a problem hiding this comment.
| [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) |
| getBaselineReference | ||
| if [ $rc -eq 0 ]; then | ||
| ERRMSG=$PGM": [INFO] Baseline reference: ${baselineRef}" | ||
| eecho $ERRMSG |
There was a problem hiding this comment.
| eecho $ERRMSG | |
| echo $ERRMSG |
| ;; | ||
| *) | ||
| rc=8 | ||
| ERRMSG=$PGM": [ERROR] Release type can only be Major, Minor or Patch. rc="$rc |
There was a problem hiding this comment.
| 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 |
dennis-behm
left a comment
There was a problem hiding this comment.
@monvora I have a few more comments. Please see below. Thank you.
| echo $ERRMSG | ||
| fi | ||
|
|
||
| tmp2=$(echo $ReleaseType | tr '[:upper:]' '[:lower:]') |
There was a problem hiding this comment.
I think this section could lead to a wrong behaviour. We should not set a default.
| 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 |
There was a problem hiding this comment.
| 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 |
|
|
||
| # internal veriables | ||
| PGM=$(basename "$0") | ||
| PGMVERS="1.10" |
There was a problem hiding this comment.
| PGMVERS="1.10" | |
| PGMVERS="1.00" |
| echo " -r <releaseType> - Type of the release " | ||
| echo " to calculate the version. " | ||
| echo " Accepted values: " | ||
| echo " - Major " |
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
OK I've seen the translation below to all lowercase, but for consistency, it would be better to have the same values everywhere.
There was a problem hiding this comment.
Updated value in the computeReleaseVersion.sh file to "major", "minor" and "patch".
dennis-behm
left a comment
There was a problem hiding this comment.
Thank you for this important script, @monvora .