-
Notifications
You must be signed in to change notification settings - Fork 130
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
First version of Gitlab pipeline template. #221
Conversation
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.
@monvora Can you please check out the comments?
GIT_STRATEGY: none | ||
GIT_CHECKOUT: "false" | ||
application: "CBSA" | ||
wdEnvironmentFileIntegration: ${WAZI_DEPLOY_SAMPLES}/plum-samples/external-repos/environment-conf/python/EOLEB7-CBSA-Integration.yml |
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 don't find an explanation for the variable WAZI_DEPLOY_SAMPLES
. Is this an environment variable configured for the service account running the pipeline steps?
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.
From my understanding, this is just installation path of Wazi Deploy. It's point to /var/WaziDeploy/wazi-deploy-samples-0.10.0/wazi-deploy-sample
. right?
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.
WAZI_DEPLOY_SAMPLES
is a CI/CD variable defined at the group level. It points to the Wazi Deploy samples location on z/OS. This is where the samples are installed and customized (actually in our setup, it is where the Wazi Deploy repository that contains our customization is cloned).
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.
@M-DLB that is what I thought at first this is only a sample file. I only document that it should be customized the path to the deployment configuration file but did not mention about the WAZI_DEPLOY_SAMPLES variable. How should we handle this in this document?
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 are passing an absolute path, while the Azure Devops pipeline is passing a relative path. So either, we switch to a relative path and specify the absolute folder path in the wdEnvironmentConfigurations
variable of the pipelineBackend.config
file, or we just leave it like this.
Also, please consider changing the path in the template since there is no existence of plum-samples anymore (replaced by wazideploy-samples, like in https://github.com/jbyibm/cics-genapp/tree/main/wazideploy-samples).
# Working directory on Linux machine | ||
buildOutputDirectory: ${CI_PROJECT_DIR}/BUILD-OUTPUT | ||
deployOutputDirectory: ${CI_PROJECT_DIR}/DEPLOY-OUTPUT | ||
baselineReferenceFile: $CI_PROJECT_DIR/CBSA/application-conf/baselineReference.config |
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 replace the concrete application nameCBSA
with an environment variable for the 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.
@dennis-behm this is actually the $CI_PROJECT_DIR already contains the name of application. CBSA is a sub-directory for source code under "CICS-Bank-Sample-Application" repository. Do you think we still need to change the this?
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.
@dennis-behm Can you please help confirm this. Than you.
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 could use the $CI_PROJECT_NAME variable, but in our case it's CICS-Bank-Sample-Application
, not CBSA
. But I agree it shouldn't hardcoded like this.
tar -xvf "${destinationLogsFile}" -C "${buildOutputDirectory}/" --strip-components 1 | ||
echo [INFO] Extracted log.tar file to ${buildOutputDirectory} | ||
else | ||
echo [WARNING] Tar file containing the logs was not found |
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.
The above condition checks if the variable is defined, not if the log file exists. Could be renamed.
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.
my bad, I meant to check if the file exist. I updated to the following.
if [ -f "${sourceLogsFile}" ]; then
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.
Oh!! I cannot check this from the definition file since the files are on USS. I would to assume it is created if the script successfully execute. With the updated ZOWE CI, we should be able to trust the RC returned.
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.
Updated to not checking any condition since the "sourceLogsFile" will always be defined and assigned the path.
|
||
# Creates the git tag using the CLI REST interface and the automation token | ||
curl --request POST --header "PRIVATE-TOKEN: ${AutomationToken}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/repository/tags?tag_name=${newVersionTag}&ref=${CI_COMMIT_REF_NAME}" | ||
|
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 check the return code of the curl request? If is successful?
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.
Ok
if [ "${releaseType}" == "major" ]; then | ||
export newVersionTag=`echo ${baselineRef} | sed 's/^["refs\/tags\/rel-]*//g' | sed 's/-[a-zA-Z0-9]*//g' | awk -F. -v OFS=. '{$1 += 1 ; $2 = 0; $3 = 0; print}'` | ||
fi | ||
echo [INFO} New verion == ${newVersionTag} |
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.
Similar comment like above.
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.
Ok
tags: [shell] | ||
script: | | ||
|
||
echo [INFO] Retrieve baseline reference information from ${baselineReferenceFile}. |
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.
Instead of calculating the git tag again, can we access the variable from the previous step?
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.
@dennis-behm I tested we need to re-calculating the git tag again. The value is not passing to the downstream job. T T
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.
Thanks for looking into this!
Templates/GitlabCIPipeline/README.md
Outdated
### Variables configuration | ||
The following variables need to be defined and configured as the environment variables in the GitLab group or project setting: | ||
|
||
Veriables | Description |
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.
Variables
instead of Veriables
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.
Done...
Templates/GitlabCIPipeline/README.md
Outdated
wdEnvironmentFileIntegration | Path to a Wazi Deploy configuration file for integration environment. | ||
wdEnvironmentFileAcceptance | Path to a Wazi Deploy configuration file for acceptance environment. | ||
wdEnvironmentFileProduction | Path to a Wazi Deploy configuration file for production environment. | ||
baselineReferenceFile | Path to baselineRefer0ence.config file of your 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.
A typo in baselineReference.config.
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.
Done...
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 made a couple of comments about the messages the script writes.
I think we can be clear that Deployment failed ...
, instead of saying Unsuccessfully ...
.
Also there is some messages with all in upper case, that can be adjusted.
I might not have added comments to all occurrences .
if [ ${RC} -eq 0 ]; then | ||
echo [INFO] Completed build application job. | ||
else | ||
echo [ERROR] Incompleted build application job with exit code ${RC}. |
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.
Instead of
Incompleted build application job with exit code
Maybe something like
Build step failed. Exit code: ${RC}
if [ ${RC} -eq 0 ]; then | ||
echo [INFO] Successfully prepare log files. | ||
|
||
echo START TRANSFER LOGS FILE = ${sourceLogsFile} to ${destinationLogsFile} |
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 also have the [INFO]
prefix for this echo?
@@ -196,16 +230,22 @@ Clone: | |||
if [ -z "${releaseCandidate}" ]; then | |||
# initial version tag | |||
export newVersionTag="${newVersionTag}_rc00" | |||
echo [INFO] 1 Update New release condidate tag == ${newVersionTag} | |||
echo [INFO] Updated release condidate tag == ${newVersionTag} |
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.
Typo - condidate
> candidate
if [ ${RC} -eq 0 ]; then | ||
echo [INFO] Release candidate tag is successfully created as ${newVersionTag}. | ||
else | ||
echo [ERROR] Release candidate tag is unsuccessfully created. |
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.
Failed to create release candidate tag
# Create integration report directory | ||
mkdir ${integrationReportDir} | ||
echo [INFO] Create integration report directory = ${integrationReportDir} | ||
# Transfer deployment report and evidence report | ||
echo [INFO] TRANSFER OUTPUT FILES = ${sourceOutputFile} to ${integrationReportDir}/deployment-report.html |
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 all message all in upper case output stands out. Maybe we can be updated to something like this:
echo [INFO] Loading deployment report ${sourceOutputFile} to ${integrationReportDir}/deployment-report.html
if [ ${RC} -eq 0 ]; then | ||
echo [INFO] Successfully transfer deployment report file. | ||
else | ||
echo [ERROR] Unsuccessfully transfer deployment report file with exit code ${RC}. |
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.
Similar to above comment
@dennis-behm Ok, I'll clean up the output message. |
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.
One comment!
Templates/GitlabCIPipeline/README.md
Outdated
RSEAPI_USER | Username for Zowe RSEAPI server authentication. This username is used when issue shell script command through Zowe. | ||
RSEAPI_PASSWORD | Password for Zowe RSEAPI server authentication. This password is used when issue shell script command through Zowe. | ||
PIPELINE_WORKSPACE | Root directory on z/OS Unix System services to perform builds. E.g. /u/gitlab/workspace | ||
WAZI_DEPLOY_CONFIGDIR | Path to a directory of Wazi Deploy configuration files. |
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 think we should say this WAZI_DEPLOY_CONFIGDIR
directory is on USS and can be populated with the samples available in https://github.com/jbyibm/cics-genapp/tree/main/wazideploy-samples
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.
@monvora Can you please update the table located at https://github.com/IBM/dbb/tree/main/Templates ?
…eline/README.md about WAZI_DEPLOY_CONFIGDIR.
Signed-off-by: Monvorath Phongpaibul <145766235+monvora@users.noreply.github.com>
Signed-off-by: Monvorath Phongpaibul <145766235+monvora@users.noreply.github.com>
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.
@monvora Thank you. Great work!
This is the first version of Gitlab pipeline template along with the documentation.