diff --git a/.github/workflows/build-packaging.yml b/.github/workflows/build-packaging.yml index 6e0e3d20c1..267ac7ea05 100644 --- a/.github/workflows/build-packaging.yml +++ b/.github/workflows/build-packaging.yml @@ -353,8 +353,8 @@ jobs: jfrog rt dl ${{github.event.inputs.PSWI_SMPE_AZWE_ARTIFACTORY_PATH}}/AZWE002*.zip --flat=true .pax/AZWE002.zip jfrog rt dl ${{github.event.inputs.PSWI_SMPE_ARTIFACTORY_PATH}}/zowe-smpe-*.zip --flat=true .pax/zowe-smpe.zip - - name: '[SMPE Pax 4] Build PSWI' + id: pswi if: env.INPUTS_BUILD_PSWI == 'true' timeout-minutes: 60 run: | @@ -367,6 +367,14 @@ jobs: ZZOW_SSH_PORT: ${{ secrets.SSH_MARIST_ALLSYS_PORT }} VERSION: ${{ env.P_VERSION }} + - name: Store PSWI folder + uses: actions/upload-artifact@v4 + if: env.INPUTS_BUILD_PSWI == 'true' && failure() + with: + name: pswi-folder + path: | + pswi/** + - name: '[K8S] Build Kubernetes' timeout-minutes: 10 if: env.INPUTS_BUILD_KUBERNETES == 'true' diff --git a/.github/workflows/pswi-zowe-config-test.yml b/.github/workflows/pswi-zowe-config-test.yml new file mode 100644 index 0000000000..96d666ba34 --- /dev/null +++ b/.github/workflows/pswi-zowe-config-test.yml @@ -0,0 +1,52 @@ +name: PSWI zowe.yaml sync check + +permissions: + id-token: write + issues: write + pull-requests: write + contents: write + +on: + push: + branches: + - v3.x/staging + pull_request: + types: [opened, synchronize] + workflow_dispatch: + +jobs: + test-pswi-zowe-yaml: + runs-on: ubuntu-latest + steps: + + - name: '[Prep 1] Checkout' + uses: actions/checkout@v4 + + - name: '[PSI-LOCK] Lock marist servers to build PSWI' + uses: zowe-actions/shared-actions/lock-resource@main + with: + lock-repository: ${{ github.repository }} + github-token: ${{ secrets.GITHUB_TOKEN }} + lock-resource-name: zowe-psi-build-zzow07-lock + lock-avg-retry-interval: 30 + + - name: 'Test ZWECONF workflow' + id: zweconf + timeout-minutes: 30 + run: | + cd pswi + ./ZWECONF_test.sh + env: + ZOSMF_USER: ${{ secrets.ZOWE_PSWI_BUILD_USR }} + ZOSMF_PASS: ${{ secrets.ZOWE_PSWI_BUILD_PASSWD }} + ZZOW_SSH_PORT: ${{ secrets.SSH_MARIST_ALLSYS_PORT }} + + - name: Store test output + uses: actions/upload-artifact@v4 + if: steps.zweconf.outcome != '' && failure() + with: + name: zweconf_test + path: | + pswi/**.txt + pswi/zowe_.yaml + pswi/ZWECONF1/** diff --git a/pswi/01_smpe.sh b/pswi/01_smpe.sh index 8370b9ef54..42d9f89aff 100644 --- a/pswi/01_smpe.sh +++ b/pswi/01_smpe.sh @@ -91,8 +91,8 @@ STATUS_NAME=`echo $RESP | grep -o '"statusName":".*"' | cut -f4 -d\"` if [ "$STATUS_NAME" = "in-progress" ] then - echo "Workflow ended with an error." - echo $RESP + echo "Workflow with SMP/E ended with an error." >> report.txt + echo $RESP >> report.txt exit -1 elif [ "$STATUS_NAME" = "complete" ] then diff --git a/pswi/02_ptf.sh b/pswi/02_ptf.sh index e2c23e54e3..e5174333d7 100644 --- a/pswi/02_ptf.sh +++ b/pswi/02_ptf.sh @@ -87,8 +87,8 @@ STATUS_NAME=`echo $RESP | grep -o '"statusName":".*"' | cut -f4 -d\"` if [ "$STATUS_NAME" = "in-progress" ] then - echo "Workflow ended with an error." - echo $RESP + echo "Workflow with PTFs ended with an error." >> report.txt + echo $RESP >> report.txt exit -1 elif [ "$STATUS_NAME" = "complete" ] then diff --git a/pswi/03_create.sh b/pswi/03_create.sh index 3f9e30fb84..724ab7ad61 100644 --- a/pswi/03_create.sh +++ b/pswi/03_create.sh @@ -79,8 +79,8 @@ then then echo "${ZOWE_MOUNT} with zFS ${ZOWE_ZFS} mounted will be used." else - echo "The file system ${ZOWE_ZFS} exists but is mounted to different mount point ${MOUNTZ}." - echo "It is required to have the file system ${ZOWE_ZFS} mounted to the exact mount point (${ZOWE_MOUNT}) to successfully export Zowe PSWI." + echo "The file system ${ZOWE_ZFS} exists but is mounted to different mount point ${MOUNTZ}." >> report.txt + echo "It is required to have the file system ${ZOWE_ZFS} mounted to the exact mount point (${ZOWE_MOUNT}) to successfully export Zowe PSWI." >> report.txt exit -1 fi else @@ -90,7 +90,7 @@ else if [ -n "$MOUNTZFS" ] then # If ZFS is not mounted to the mountpoint then this ZOWE mountpoint has different zFS - echo "The mountpoint ${ZOWE_MOUNT} has different zFS ${MOUNTZFS}." + echo "The mountpoint ${ZOWE_MOUNT} has different zFS ${MOUNTZFS}." >> report.txt exit -1 else # Mount zFS to Zowe mountpoint @@ -108,14 +108,14 @@ RESP=`curl -s $CHECK_WORKFLOW_DSN_URL -k -X "GET" -H "Content-Type: application/ DS_COUNT=`echo $RESP | grep -o '"returnedRows":[0-9]*' | cut -f2 -d:` if [ $DS_COUNT -ne 0 ] then - echo "The ${WORKFLOW_DSN} already exist. Because there is a possibility that it contains something unwanted the script does not continue." + echo "The ${WORKFLOW_DSN} already exist. Because there is a possibility that it contains something unwanted the script does not continue." >> report.txt exit -1 else echo "Creating a data set where the post-Deployment workflow will be stored." RESP=`curl -s $WORKFLOW_DSN_URL -k -X "POST" -d "$ADD_WORKFLOW_DSN_JSON" -H "Content-Type: application/json" -H "X-CSRF-ZOSMF-HEADER: A" --user $ZOSMF_USER:$ZOSMF_PASS` if [ -n "$RESP" ] then - echo "The creation of the ${WORKFLOW_DSN} was not successful. Error message: ${RESP}" + echo "The creation of the ${WORKFLOW_DSN} was not successful. Error message: ${RESP}" >> report.txt exit -1 fi fi @@ -173,7 +173,7 @@ RESP=`curl -s $CHECK_EXPORT_DSN_URL -k -X "GET" -H "Content-Type: application/js DSN_COUNT=`echo $RESP | grep -o '"returnedRows":[0-9]*' | cut -f2 -d:` if [ $DSN_COUNT -ne 0 ] then - echo "The ${EXPORT_DSN} already exist. Because there is a possibility that it contains something unwanted the script does not continue." + echo "The ${EXPORT_DSN} already exist. Because there is a possibility that it contains something unwanted the script does not continue." >> report.txt exit -1 else echo "Creating a data set where the export jobs will be stored." @@ -209,7 +209,7 @@ if [ $? -gt 0 ];then exit -1;fi LOAD_STATUS_URL=`echo $RESP | grep -o '"statusurl":".*"' | cut -f4 -d\" | tr -d '\' 2>/dev/null` if [ -z "$LOAD_STATUS_URL" ] then - echo "No response from the REST API call." + echo "No response from the load product REST API call." >> report.txt exit -1 fi @@ -239,7 +239,7 @@ if [ $? -gt 0 ];then exit -1;fi EXPORT_STATUS_URL=`echo $RESP | grep -o '"statusurl":".*"' | cut -f4 -d\" | tr -d '\' 2>/dev/null` if [ -z "$EXPORT_STATUS_URL" ] then - echo "No response from the REST API call." + echo "No response from the export REST API call." >> report.txt exit -1 fi @@ -266,7 +266,7 @@ then # Can be 100% but still running if [ "$STATUS" != "complete" ] && [ "$STATUS" != "running" ] then - echo "Status of generation of Export JCL failed." + echo "Status of generation of Export JCL failed." >> report.txt exit -1 fi fi @@ -275,7 +275,7 @@ done if [ -z "$DSN" ] then - echo "The creation of export JCL failed" + echo "The creation of export JCL failed" >> report.txt exit -1 fi diff --git a/pswi/051_test_workflows.sh b/pswi/051_test_workflows.sh new file mode 100644 index 0000000000..fed47c1345 --- /dev/null +++ b/pswi/051_test_workflows.sh @@ -0,0 +1,28 @@ +#!/bin/sh +#version=1.0 + +export BASE_URL="${ZOSMF_URL}:${ZOSMF_PORT}" + +echo "" +echo "" +echo "Script for testing workflows..." +echo "Host :" $ZOSMF_URL +echo "Port :" $ZOSMF_PORT +echo "SSH Port :" $ZZOW_SSH_PORT +echo "z/OSMF system :" $ZOSMF_SYSTEM +echo "Test HLQ :" $TEST_HLQ +echo "Test mount point :" $TEST_MOUNT +echo "Work zFS :" $WORK_ZFS # For z/OSMF v2.3 +echo "Work mount point :" $WORK_MOUNT # For z/OSMF v2.3 + +echo "Mounting ${TEST_HLQ}.ZFS" +sh scripts/tmp_mounts.sh "${TEST_HLQ}.ZFS" "${TEST_MOUNT}" +if [ $? -gt 0 ]; then exit -1; fi + +echo "Registering/testing the configuration workflow ${TEST_HLQ}.WORKFLOW(ZWECONF)" +sh scripts/wf_run_test.sh "${TEST_HLQ}.WORKFLOW(ZWECONF)" +if [ $? -gt 0 ];then exit -1;fi + +echo "Registering/testing the configuration workflow ${TEST_MOUNT}/files/workflows/ZWECONF.xml" +sh scripts/wf_run_test.sh "${TEST_MOUNT}/files/workflows/ZWECONF.xml" +if [ $? -gt 0 ];then exit -1;fi diff --git a/pswi/05_test.sh b/pswi/05_test.sh index 7f703b4b15..94afd818a2 100644 --- a/pswi/05_test.sh +++ b/pswi/05_test.sh @@ -72,15 +72,3 @@ echo " Running the deployment test for z/OSMF version 2.3" pip install requests python scripts/deploy_test_2_3.py - -echo "Mounting ${TEST_HLQ}.ZFS" -sh scripts/tmp_mounts.sh "${TEST_HLQ}.ZFS" "${TEST_MOUNT}" -if [ $? -gt 0 ]; then exit -1; fi - -echo "Registering/testing the configuration workflow ${TEST_HLQ}.WORKFLOW(ZWECONF)" -sh scripts/wf_run_test.sh "${TEST_HLQ}.WORKFLOW(ZWECONF)" -if [ $? -gt 0 ];then exit -1;fi - -echo "Registering/testing the configuration workflow ${TEST_MOUNT}/content/files/workflows/ZWECONF.xml" -sh scripts/wf_run_test.sh "${TEST_MOUNT}/files/workflows/ZWECONF.xml" -if [ $? -gt 0 ];then exit -1;fi diff --git a/pswi/PSWI-marist.sh b/pswi/PSWI-marist.sh index 80441508af..67fcedf490 100755 --- a/pswi/PSWI-marist.sh +++ b/pswi/PSWI-marist.sh @@ -1,12 +1,13 @@ +set -x export ZOSMF_URL="https://zzow07.zowe.marist.cloud" export ZOSMF_PORT=10443 export ZOSMF_SYSTEM="S0W1" -export DIR="/u/zowead2" -export SMPEHLQ="ZOWEAD2" -export TMP_ZFS="ZOWEAD2.TMP.ZFS" +export DIR="/u/${ZOSMF_USER,,}" +export SMPEHLQ="${ZOSMF_USER}" +export TMP_ZFS="${ZOSMF_USER}.TMP.ZFS" export ZOWE_MOUNT="/u/zwe/zowe-smpe/" export VOLUME="ZOS003" -export TEST_HLQ="ZOWEAD2.PSWIT" +export TEST_HLQ="${ZOSMF_USER}.PSWIT" export SYSAFF="(S0W1)" export ACCOUNT=1 @@ -29,7 +30,7 @@ export TMP_MOUNT="${DIR}/zowe-tmp" export TEST_MOUNT="${DIR}/test_mount" export EXPORT="${TMP_MOUNT}/export/" export WORK_MOUNT="${DIR}/work" -export WORK_ZFS="ZOWEAD2.WORK.ZFS" +export WORK_ZFS="${ZOSMF_USER}.WORK.ZFS" export ZOSMF_V="2.3" export SMPE_WF_NAME="ZOWE_SMPE_WF" export PTF_WF_NAME="ZOWE_PTF_WF" @@ -41,7 +42,7 @@ if [ -f ../.pax/zowe-smpe.zip ]; then mkdir -p "unzipped" unzip ../.pax/zowe-smpe.zip -d unzipped else - echo "zowe-smpe file not found" + echo "zowe-smpe file not found" >> report.txt exit -1 fi @@ -73,7 +74,7 @@ else if [ -f ../.pax/${FMID}.zip ]; then unzip ../.pax/${FMID}.zip -d unzipped else - echo "File with FMID not found" + echo "File with FMID not found" >> report.txt exit -1 fi fi @@ -90,6 +91,14 @@ export WORKFLOW_DSN=${CSIHLQ}.WORKFLOW export ZOWE_ZFS="${CSIHLQ}.ZFS" export VERSION=$(cat ../manifest.json.template | grep -o '"version": ".*"' | head -1 | cut -f4 -d\") +# Initialize variables +presmpe=0 +smpe=0 +ptf=0 +create=0 +test=0 +wf_test=0 + # Upload and prepare all files sh 00_presmpe.sh presmpe=$? @@ -125,7 +134,13 @@ if [ $presmpe -eq 0 ]; then # Test PSWI sh 05_test.sh test=$? - + + if [ $test -eq 0 ]; then + #test the workflows + sh 051_test_workflows.sh + wf_test=$? + fi + # Cleanup after the test sh 06_test_cleanup.sh fi @@ -141,23 +156,28 @@ if [ $presmpe -eq 0 ]; then # Clean RELFILEs and PTFs sh 08_presmpe_cleanup.sh fi +else + # Clean RELFILEs and PTFs + sh 08_presmpe_cleanup.sh fi echo "" echo "" -if [ $smpe -ne 0 ] || [ $ptf -ne 0 ] || [ $create -ne 0 ] || [ $test -ne 0 ] || [ $presmpe -ne 0 ]; then - echo "Build unsuccessful!" +if [ $smpe -ne 0 ] || [ $ptf -ne 0 ] || [ $create -ne 0 ] || [ $test -ne 0 ] || [ $presmpe -ne 0 ] || [ $wf_test -ne 0 ]; then + echo "Build unsuccessful!" >> report.txt if [ $presmpe -ne 0 ]; then - echo "Pre-SMP/E wasn't successful." + echo "Pre-SMP/E wasn't successful." >> report.txt elif [ $smpe -ne 0 ]; then - echo "SMP/E wasn't successful." + echo "SMP/E wasn't successful." >> report.txt elif [ $ptf -ne 0 ]; then - echo "Applying PTFs wasn't successful." + echo "Applying PTFs wasn't successful." >> report.txt elif [ $create -ne 0 ]; then - echo "Creation of PSWI wasn't successful." + echo "Creation of PSWI wasn't successful." >> report.txt elif [ $test -ne 0 ]; then - echo "Testing of PSWI wasn't successful." + echo "Testing of PSWI wasn't successful." >> report.txt + elif [ $wf_test -ne 0 ]; then + echo "Workflow testing wasn't successful." >> report.txt fi exit -1 else diff --git a/pswi/ZWECONF_test.sh b/pswi/ZWECONF_test.sh new file mode 100755 index 0000000000..346c997e45 --- /dev/null +++ b/pswi/ZWECONF_test.sh @@ -0,0 +1,60 @@ +export ZOSMF_URL="https://zzow07.zowe.marist.cloud" +export ZOSMF_PORT=10443 +export ZOSMF_SYSTEM="S0W1" +export JOBNAME="ZWECONF1" +export HOST=${ZOSMF_URL#https:\/\/} +export BASE_URL="${ZOSMF_URL}:${ZOSMF_PORT}" +WORK_MOUNT="/tmp" + +echo "Changing runtime path in ZWECONF.properties." + +cp ../workflows/files/ZWECONF.properties ./ZWECONF.properties +sed "s|runtimeDirectory=|runtimeDirectory=${WORK_MOUNT}|g" ./ZWECONF.properties > _ZWECONF +sed "s|java_home=|java_home=#delete_me#|g" _ZWECONF > ZWECONF +sed "s|node_home=|node_home=#delete_me#|g" ZWECONF > _ZWECONF + +echo "Changing the configuration workflow to be fully automated." + +cp ../workflows/files/ZWECONF.xml ./ZWECONF.xml +sed "s|false|true|g" ./ZWECONF.xml > ZWECONFX + +sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF +cd ${WORK_MOUNT} +put _ZWECONF +put ZWECONFX +EOF + +echo "Testing the configuration workflow ${WORK_MOUNT}/ZWECONFX" +sh scripts/wf_run_test.sh "${WORK_MOUNT}/ZWECONFX" "run" "ZWECONF" "${WORK_MOUNT}/_ZWECONF" +if [ $? -gt 0 ];then exit -1;fi + +echo "Converting zowe.yaml" + +echo "//${ZOSMF_SYSTEM} JOB (1),'PSWI',MSGCLASS=A,REGION=0M" > JCL +echo "/*JOBPARM SYSAFF=(${ZOSMF_SYSTEM})" >> JCL +echo "//UNPAXDIR EXEC PGM=BPXBATCH" >> JCL +echo "//STDOUT DD SYSOUT=*" >> JCL +echo "//STDERR DD SYSOUT=*" >> JCL +echo "//STDPARM DD *" >> JCL +echo "SH set -x;set -e;" >> JCL +echo "cd ${WORK_MOUNT};" >> JCL +echo "iconv -f IBM-1047 -t ISO8859-1 zowe.yaml > zowe_.yaml;" >> JCL +echo "/*" >> JCL + +sh scripts/submit_jcl.sh "`cat JCL`" +if [ $? -gt 0 ];then exit -1;fi +rm JCL + +sshpass -p${ZOSMF_PASS} sftp -o HostKeyAlgorithms=+ssh-rsa -o BatchMode=no -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -b - -P ${ZZOW_SSH_PORT} ${ZOSMF_USER}@${HOST} << EOF +cd ${WORK_MOUNT} +get zowe_.yaml +rm zowe_.yaml +EOF + +pwd + +cp ../example-zowe.yaml example-zowe.yaml + +diff --ed example-zowe.yaml zowe_.yaml > diff.txt || true + +diff --ed diff.txt scripts/base_diff.txt > final_diff.txt diff --git a/pswi/scripts/base_diff.txt b/pswi/scripts/base_diff.txt new file mode 100644 index 0000000000..d23d5ebdc1 --- /dev/null +++ b/pswi/scripts/base_diff.txt @@ -0,0 +1,46 @@ +483c + home: "#delete_me#" +. +468c + 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 +. diff --git a/pswi/scripts/check_response.sh b/pswi/scripts/check_response.sh index b9b280848e..b589cf88d2 100644 --- a/pswi/scripts/check_response.sh +++ b/pswi/scripts/check_response.sh @@ -5,13 +5,13 @@ REASON=`echo $RESP | grep -o '"reason":'` MSG=`echo $RESP | grep -o '"messageText":'` if [ -n "$REASON" ] || [ -n "$MSG" ] then - echo $RESP + echo $RESP >> report.txt exit -1 fi if [ $RESPCODE -ne 0 ] then - echo "REST API call failed." - echo $RESP + echo "REST API call failed." >> report.txt + echo $RESP >> report.txt exit -1 else echo "REST API call was successful." diff --git a/pswi/scripts/submit_jcl.sh b/pswi/scripts/submit_jcl.sh index 58f32f3805..43a5c672ba 100644 --- a/pswi/scripts/submit_jcl.sh +++ b/pswi/scripts/submit_jcl.sh @@ -11,7 +11,7 @@ sh scripts/check_response.sh "${RESP}" $? JOB_STATUS_URL=`echo $RESP | grep -o '"url":".*"' | cut -f4 -d\" | tr -d '\' 2>/dev/null` if [ -z "$JOB_STATUS_URL" ] then - echo "No response from the REST API call." + echo "No response from the REST API call." >> report.txt exit -1 fi JOBID=`echo $RESP | grep -o '"jobid":".*"' | cut -f4 -d\"` @@ -49,7 +49,7 @@ if [ "$RC" = "CC 0000" ] then echo "${JOBNAME} ${JOBID} was completed." else - echo "${JOBNAME} ${JOBID} failed." - cat $JOBNAME/$JOBID + echo "${JOBNAME} ${JOBID} failed." >> report.txt + cat $JOBNAME/$JOBID >> report.txt exit -1 fi diff --git a/pswi/scripts/tmp_mounts.sh b/pswi/scripts/tmp_mounts.sh index 23fa144cdb..eb44340d58 100644 --- a/pswi/scripts/tmp_mounts.sh +++ b/pswi/scripts/tmp_mounts.sh @@ -20,8 +20,8 @@ then echo "${MOUNT} with zFS ${ZFS} mounted will be used as is." MOUNTED=true else - echo "The file system ${ZFS} exists but is mounted to different mount point(${MOUNTP})." - echo "Use different name of zFS or ${MOUNTP} for mount point." + echo "The file system ${ZFS} exists but is mounted to different mount point(${MOUNTP})." >> report.txt + echo "Use different name of zFS or ${MOUNTP} for mount point." >> report.txt exit -1 fi else @@ -33,9 +33,9 @@ else if [ -n "$MOUNTZFS" ] then # If zFS is not mounted to the mount point then this mount point has different zFS - echo "The mount point ${MOUNT} has different zFS (${MOUNTZFS}) mounted." - echo "Use different mount point (not ${MOUNT})." - echo "Or use ${MOUNTZFS} for zFS." + echo "The mount point ${MOUNT} has different zFS (${MOUNTZFS}) mounted." >> report.txt + echo "Use different mount point (not ${MOUNT})." >> report.txt + echo "Or use ${MOUNTZFS} for zFS." >> report.txt exit -1 fi fi diff --git a/pswi/scripts/wf_run_test.sh b/pswi/scripts/wf_run_test.sh index 6cc05b8246..e31a8e3c19 100755 --- a/pswi/scripts/wf_run_test.sh +++ b/pswi/scripts/wf_run_test.sh @@ -4,14 +4,17 @@ export BASE_URL="${ZOSMF_URL}:${ZOSMF_PORT}" WF_DEF_FILE=$1 run=$2 +ZWECONF=$3 +INPUT_FILE=$4 echo "" echo "" -echo "Script for testing workflow and if specified running with defaults as well..." +echo "Script for testing workflow and if specified running with defaults/variable input file as well..." echo "Host :" $ZOSMF_URL echo "Port :" $ZOSMF_PORT echo "z/OSMF system :" $ZOSMF_SYSTEM echo "Workflow definition file :" $WF_DEF_FILE +echo "Variable Input file :" $INPUT_FILE WF_NAME="Testing_workflows" # URLs @@ -19,13 +22,23 @@ CREATE_WF_URL="${BASE_URL}/zosmf/workflow/rest/1.0/workflows" WF_LIST_URL="${BASE_URL}/zosmf/workflow/rest/1.0/workflows?owner=${ZOSMF_USER}&workflowName=${WF_NAME}" # JSONs - +if [ -n "$INPUT_FILE" ] +then +ADD_WORKFLOW_JSON='{"workflowName":"'$WF_NAME'", +"workflowDefinitionFile":"'${WF_DEF_FILE}'", +"variableInputFile":"'${INPUT_FILE}'", +"system":"'$ZOSMF_SYSTEM'", +"owner":"'$ZOSMF_USER'", +"assignToOwner" :true}' +else ADD_WORKFLOW_JSON='{"workflowName":"'$WF_NAME'", "workflowDefinitionFile":"'${WF_DEF_FILE}'", "system":"'$ZOSMF_SYSTEM'", "owner":"'$ZOSMF_USER'", "assignToOwner" :true}' +fi +set -x # Get workflowKey for the workflow owned by user echo "Get workflowKey for the workflow if it exists." @@ -41,7 +54,6 @@ RESP=`curl -s $WORKFLOW_URL -k -X "DELETE" -H "Content-Type: application/json" - sh scripts/check_response.sh "${RESP}" $? fi -set -ex # Create workflow with REST API echo 'Invoking REST API to create the workflow.' @@ -51,7 +63,7 @@ if [ $? -gt 0 ];then exit -1;fi WFKEY=`echo $RESP | grep -o '"workflowKey":".*"' | cut -f4 -d\"` WORKFLOW_URL="${CREATE_WF_URL}/${WFKEY}" -if [ -n "${run}" ] +if [ "$run" = "run" ] then # Run workflow echo "Invoking REST API to start the workflow." @@ -72,9 +84,25 @@ STATUS_NAME=`echo $RESP | grep -o '"statusName":".*"' | cut -f4 -d\"` if [ "$STATUS_NAME" = "in-progress" ] then - echo "Workflow ended with an error." - echo $RESP - exit -1 + echo "Workflow ended with an error." >> report.txt + echo $RESP >> report.txt + echo "Checking if the workflow is ZWECONF" >> report.txt + if [ "$ZWECONF" = "ZWECONF" ] + then + STEP_NAME=`echo $RESP | grep -o '"currentStepName":".*"' | cut -f4 -d\"` + if [ "$STEP_NAME" = "init_zowe" ] + then + echo "The workflow is ZWECONF and should end in step 'init_zowe'" + STATUS="FINISHED" + else + echo "The workflow is ZWECONF but ended in different step: '$STEP_NAME'" >> report.txt + exit -1 + fi + else + echo "Workflow ended with an error and it is not ZWECONF." >> report.txt + echo $RESP >> report.txt + exit -1 + fi elif [ "$STATUS_NAME" = "complete" ] then echo "Workflow finished successfully." diff --git a/workflows/files/ZWECONF.properties b/workflows/files/ZWECONF.properties index 19b10127fc..ccf3efc3a8 100644 --- a/workflows/files/ZWECONF.properties +++ b/workflows/files/ZWECONF.properties @@ -393,53 +393,54 @@ components_zaas_port=7558 # Switch on the debug mode for the ZAAS components_zaas_debug=false -# components_zaas_apiml_security_auth_provider -# Label: ZAAS APIML security auth provider -# Abstract: Authorization provider for the ZAAS +# components_gateway_apiml_security_auth_provider +# Label: APIML security auth provider +# Abstract: Authorization provider for the gateway # Category: components # Description: -# Authorization provider for the ZAAS -components_zaas_apiml_security_auth_provider=zosmf +# Authorization provider for the gateway +components_gateway_apiml_security_auth_provider=zosmf -# components_zaas_apiml_security_auth_zosmf_jwtAutoconfiguration -# Label: ZAAS APIML security auth z/OSMF jwtAutoconfiguration +# components_gateway_apiml_security_auth_zosmf_jwtAutoconfiguration +# Label: APIML security auth z/OSMF jwtAutoconfiguration # Abstract: JWT auto configuration for gateway security auth # Category: components # Description: -# JWT auto configuration for ZAAS (Authentication) -components_zaas_apiml_security_auth_zosmf_jwtAutoconfiguration=jwt +# JWT auto configuration for gateway security auth +# Choices: jwt,ltpa +components_gateway_apiml_security_auth_zosmf_jwtAutoconfiguration=jwt -# components_zaas_apiml_security_auth_zosmf_serviceId -# Label: ZAAS APIML security auth z/OSMF serviceId -# Abstract: Service ID for ZAAS security auth +# components_gateway_apiml_security_auth_zosmf_serviceId +# Label: APIML security auth z/OSMF serviceId +# Abstract: Service ID for gateway security auth # Category: components # Description: -# Service ID for ZAAS security auth -components_zaas_apiml_security_auth_zosmf_serviceId=ibmzosmf +# Service ID for gateway security auth +components_gateway_apiml_security_auth_zosmf_serviceId=ibmzosmf -# components_zaas_apiml_security_authorization_endpoint_enabled -# Label: Enable ZAAS APIML security authorization endpoint +# components_gateway_apiml_security_authorization_endpoint_enabled +# Label: Enable APIML security authorization endpoint # Abstract: Use this to enable the security authorization endpoint # Category: components # Description: # Use this to enable the security authorization endpoint -components_zaas_apiml_security_authorization_endpoint_enabled=false +components_gateway_apiml_security_authorization_endpoint_enabled=false -# components_zaas_apiml_security_authorization_provider -# Label: ZAAS APIML security authorization provider -# Abstract: Security authorization provider for the ZAAS +# components_gateway_apiml_security_authorization_provider +# Label: APIML security authorization provider +# Abstract: Security authorization provider for the gateway # Category: components # Description: -# Security authorization provider for the ZAAS -components_zaas_apiml_security_authorization_provider=native +# Security authorization provider for the gateway +components_gateway_apiml_security_authorization_provider=native -# components_zaas_apiml_security_x509_enabled -# Label: Enable ZAAS APIML security x509 -# Abstract: Check to enable the ZAAS security x509 +# components_gateway_apiml_security_x509_enabled +# Label: Enable APIML security x509 +# Abstract: Check to enable the gateway security x509 # Category: components # Description: -# Check to enable the ZAAS security x509 -components_zaas_apiml_security_x509_enabled=false +# Check to enable the gateway security x509 +components_gateway_apiml_security_x509_enabled=false # components_api_catalog_enabled # Label: Enable API Catalog @@ -773,4 +774,4 @@ zowe_setup_security_stcs_aux=ZWESASTC # Check this option to enable the optional workflow step with zwe install command. After Zowe convenience build is extracted, # you can enable this flag to run the zwe install command to install MVS data sets within this workflow run. # This option is for convenience build only. SMP/E installs the MVS data sets during installation. -zowe_setup_installStep_enabled=false +zowe_setup_installStep_enabled=false \ No newline at end of file diff --git a/workflows/files/ZWECONF.xml b/workflows/files/ZWECONF.xml index f995c29822..b9a54cde87 100644 --- a/workflows/files/ZWECONF.xml +++ b/workflows/files/ZWECONF.xml @@ -567,10 +567,10 @@ How we want to verify SSL certificates of services. Valid values are: false - - - Authorization provider for the ZAAS - Authorization provider for the ZAAS + + + Authorization provider for the gateway + Authorization provider for the gateway components @@ -578,8 +578,8 @@ How we want to verify SSL certificates of services. Valid values are: zosmf - - + + JWT auto configuration for gateway security auth JWT auto configuration for gateway security auth components @@ -591,10 +591,10 @@ How we want to verify SSL certificates of services. Valid values are: jwt - - - Service ID for ZAAS security auth - Service ID for ZAAS security auth + + + Service ID for gateway security auth + Service ID for gateway security auth components @@ -602,8 +602,8 @@ How we want to verify SSL certificates of services. Valid values are: ibmzosmf - - + + Use this to enable the security authorization endpoint Use this to enable the security authorization endpoint components @@ -613,10 +613,10 @@ How we want to verify SSL certificates of services. Valid values are: false - - - Security authorization provider for the ZAAS - Security authorization provider for the ZAAS + + + Security authorization provider for the gateway + Security authorization provider for the gateway components @@ -624,10 +624,10 @@ How we want to verify SSL certificates of services. Valid values are: native - - - Check to enable the ZAAS security x509 - Check to enable the ZAAS security x509 + + + Check to enable the gateway security x509 + Check to enable the gateway security x509 components @@ -1201,6 +1201,12 @@ How we want to verify SSL certificates of services. Valid values are: + + + + + + Run this step to specify the cloud gateway variables 1 z/OS System Programmer @@ -1225,12 +1231,6 @@ How we want to verify SSL certificates of services. Valid values are: - - - - - - Run this step to fill gateway component variables. 1 z/OS System Programmer @@ -1985,12 +1985,38 @@ echo ' gateway:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' enabled: ${instance-components_gateway_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' port: ${instance-components_gateway_port}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' debug: ${instance-components_gateway_debug}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' apiml:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' security:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' auth:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' provider: $!{instance-components_gateway_apiml_security_auth_provider}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' zosmf:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' jwtAutoconfiguration: $!{instance-components_gateway_apiml_security_auth_zosmf_jwtAutoconfiguration}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' serviceId: $!{instance-components_gateway_apiml_security_auth_zosmf_serviceId}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' authorization:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' endpoint:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' enabled: ${instance-components_gateway_apiml_security_authorization_endpoint_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' provider: "$!{instance-components_gateway_apiml_security_authorization_provider}"' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' x509:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' enabled: ${instance-components_gateway_apiml_security_x509_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" #end #if (${instance-components_gateway_enabled} == "false" ) echo ' gateway:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' enabled: ${instance-components_gateway_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' port: 7554' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' debug: false' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' apiml:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' security:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' auth:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' provider: zosmf' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' zosmf:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' jwtAutoconfiguration: auto' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' serviceId: ibmzosmf' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' authorization:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' endpoint:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' enabled: false' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' provider: "native"' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' x509:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" +echo ' enabled: false' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" #end echo '' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' # If we customize this to use different external certificate, than should also' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" @@ -2005,38 +2031,12 @@ echo ' zaas:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' enabled: ${instance-components_zaas_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' port: ${instance-components_zaas_port}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' debug: ${instance-components_zaas_debug}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' apiml:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' security:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' auth:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' provider: $!{instance-components_zaas_apiml_security_auth_provider}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' zosmf:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' jwtAutoconfiguration: $!{instance-components_zaas_apiml_security_auth_zosmf_jwtAutoconfiguration}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' serviceId: $!{instance-components_zaas_apiml_security_auth_zosmf_serviceId}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' authorization:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' endpoint:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' enabled: ${instance-components_zaas_apiml_security_authorization_endpoint_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' provider: "$!{instance-components_zaas_apiml_security_authorization_provider}"' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' x509:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' enabled: ${instance-components_zaas_apiml_security_x509_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" #end #if (${instance-components_zaas_enabled} == "false" ) echo ' zaas:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' enabled: ${instance-components_zaas_enabled}' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' port: 7558' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" echo ' debug: false' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' apiml:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' security:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' auth:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' provider: zosmf' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' zosmf:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' jwtAutoconfiguration: auto' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' serviceId: ibmzosmf' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' authorization:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' endpoint:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' enabled: false' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' provider: "native"' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' x509:' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" -echo ' enabled: false' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" #end echo ' # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>' >> "${instance-zowe_runtimeDirectory}/zowe.yaml" #if (${instance-components_api_catalog_enabled} == "true" )