Skip to content
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

Users/muzikovam/yaml check #4072

Merged
merged 9 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions pswi/ZWECONF_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ export ZOSMF_SYSTEM="S0W1"
export JOBNAME="ZWECONF1"
export HOST=${ZOSMF_URL#https:\/\/}
export BASE_URL="${ZOSMF_URL}:${ZOSMF_PORT}"
CURR_TIME=$(date +%s)
export LOG_DIR="logs/$CURR_TIME"
mkdir -p $LOG_DIR
WORK_MOUNT="/tmp"

echo "Changing runtime path in ZWECONF.properties."
Expand Down Expand Up @@ -55,6 +58,30 @@ pwd

cp ../example-zowe.yaml example-zowe.yaml

diff --ed example-zowe.yaml zowe_.yaml >diff.txt || true
diff example-zowe.yaml zowe_.yaml >diff.txt || true

diff --ed diff.txt scripts/base_diff.txt >final_diff.txt
diff diff.txt scripts/base_diff.txt >final_diff.txt || true

concat=$(cat final_diff.txt)

if [ -n "$concat" ]
then
echo "There are some discrepancies between the example-zowe.yaml and the zowe.yaml created by ZWECONF.xml workflow."
echo "Please add to or delete from the ZWECONF.xml workflow what needs or doesn't need to be there."
echo "E.g. if there is a new variable you need to add it first to the workflow variables, then add the variable to the"
echo "'main_variables' step and then also to the step where the zowe.yaml is created."
echo "If there was added/deleted just a comment in the example-zowe.yaml please add it also to the workflow so"
echo "this step is not failing."
echo "Here is the output from the diff command:" # They will surely know what is diff cmd, right
while read -r line; do
if [[ "$line" =~ ^\< ]]; then
echo $line >> final_final_diff.txt
fi
done <final_diff.txt
cat final_final_diff.txt
echo "------------------------------------------------------------------------"
echo "First line is from the example-zowe.yaml and the line bellow is from the"
echo "zowe.yaml created by the ZWECONF.xm workflow."
cp final_final_diff.txt $LOG_DIR/diff_output.txt
exit -1
fi
126 changes: 80 additions & 46 deletions pswi/scripts/base_diff.txt
Original file line number Diff line number Diff line change
@@ -1,46 +1,80 @@
471c
home: "#delete_me#"
.
456c
home: "#delete_me#"
.
281c
runtimeDirectory: "/tmp"
.
106c
# directory:
.
100,103c
# certificate:
# Type of certificate storage. Valid values are: PKCS12, JCEKS, JCECCAKS, JCERACFKS, JCECCARACFKS, or JCEHYBRIDRACFKS
# type:
# pkcs12:
.
66,91c
# Security related configurations. This setup is optional.
security:
# security product name. Can be RACF, ACF2 or TSS
product: RACF
# security group name
groups:
# Zowe admin user group
admin: ZWEADMIN
# Zowe STC group
stc: ZWEADMIN
# Zowe SysProg group
sysProg: ZWEADMIN
# security user name
users:
# Zowe runtime user name of main service
zowe: ZWESVUSR
# Zowe runtime user name of ZIS
zis: ZWESIUSR
# STC names
stcs:
# STC name of Zowe main service
zowe: ZWESLSTC
# STC name of Zowe ZIS
zis: ZWESISTC
# STC name of Zowe ZIS Auxiliary Server
aux: ZWESASTC
.
66,91c66,91
< # # Security related configurations. This setup is optional.
< # security:
< # # security product name. Can be RACF, ACF2 or TSS
< # product: RACF
< # # security group name
< # groups:
< # # Zowe admin user group
< # admin: ZWEADMIN
< # # Zowe STC group
< # stc: ZWEADMIN
< # # Zowe SysProg group
< # sysProg: ZWEADMIN
< # # security user name
< # users:
< # # Zowe runtime user name of main service
< # zowe: ZWESVUSR
< # # Zowe runtime user name of ZIS
< # zis: ZWESIUSR
< # # STC names
< # stcs:
< # # STC name of Zowe main service
< # zowe: ZWESLSTC
< # # STC name of Zowe ZIS
< # zis: ZWESISTC
< # # STC name of Zowe ZIS Auxiliary Server
< # aux: ZWESASTC
---
> # Security related configurations. This setup is optional.
> security:
> # security product name. Can be RACF, ACF2 or TSS
> product: RACF
> # security group name
> groups:
> # Zowe admin user group
> admin: ZWEADMIN
> # Zowe STC group
> stc: ZWEADMIN
> # Zowe SysProg group
> sysProg: ZWEADMIN
> # security user name
> users:
> # Zowe runtime user name of main service
> zowe: ZWESVUSR
> # Zowe runtime user name of ZIS
> zis: ZWESIUSR
> # STC names
> stcs:
> # STC name of Zowe main service
> zowe: ZWESLSTC
> # STC name of Zowe ZIS
> zis: ZWESISTC
> # STC name of Zowe ZIS Auxiliary Server
> aux: ZWESASTC
100,103c100,103
< certificate:
< # Type of certificate storage. Valid values are: PKCS12, JCERACFKS. APIML additionally supports: JCEKS, JCECCAKS, JCECCARACFKS, or JCEHYBRIDRACFKS
< type: PKCS12
< pkcs12:
---
> # certificate:
> # Type of certificate storage. Valid values are: PKCS12, JCEKS, JCECCAKS, JCERACFKS, JCECCARACFKS, or JCEHYBRIDRACFKS
> # type:
> # pkcs12:
106c106
< directory: /var/zowe/keystore
---
> # directory:
281c281
< runtimeDirectory: ""
---
> runtimeDirectory: "/tmp"
456c456
< home: ""
---
> home: "#delete_me#"
471c471
< home: ""
---
> home: "#delete_me#"
2 changes: 1 addition & 1 deletion workflows/files/ZWECONF.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1809,7 +1809,7 @@ echo ' # ZWED_TN3270_PORT: 23' >> "${instance-zowe_runtimeDirectory}/zowe.yam
echo '' >> "${instance-zowe_runtimeDirectory}/zowe.yaml"
echo ' # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>' >> "${instance-zowe_runtimeDirectory}/zowe.yaml"
echo ' # You can define any Zowe message portions to be checked for and the message added to the' >> "${instance-zowe_runtimeDirectory}/zowe.yaml"
echo ' # system log upon its logging, truncated to 126 characters.' >> "${instance-zowe_runtimeDirectory}/zowe.yaml"
echo ' # system log upon its logging, truncated to 126 characters (wildcards are not supported).' >> "${instance-zowe_runtimeDirectory}/zowe.yaml"
echo ' sysMessages:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml"
echo ' # # Zowe starting' >> "${instance-zowe_runtimeDirectory}/zowe.yaml"
echo ' - "ZWEL0021I"' >> "${instance-zowe_runtimeDirectory}/zowe.yaml"
Expand Down
Loading