How to connect CA OPS/MVS to CICD with ZOWE CLI

Jack Hartzler
Zowe
Published in
3 min readSep 26, 2019

A major benefit of Zowe CLI is the ability to expose mainframe elements to off-platform tools, especially for the purpose of CICD. A great example of this can be found in Dan Kelosky’s post (link below), in which he demonstrates how to edit, reassemble, and test a sample assembler program using Zowe.

However, more often than not, the process you’re testing is a bit heavier-weight than just a sample assembler program, and it isn’t so easy to bring up and down. For example, consider a started task managed by SSM (System State Manager, a facility of CA OPS/MVS for those unfamiliar with it). While there are a variety of ways to recycle a started task, simply starting or stopping a job using JCL or using Zowe automated job submission might leave out some key steps for an SSM managed resource.

For situations like this, the CA OPS/MVS plugin for Zowe provides a bridge between the convenience of Zowe and your existing SSM automation.

Consider the scenario where you have a Jenkins job that applies maintenance to this resource using Zowe. You want to test it to see if it still passes acceptance tests before staging it for production.

You can use the following commands to bring the resource up and down and to make sure the build is working by polling the resource status.

zowe ops-mvs set ssm-desired-state $resource $table --current $currentState --new $newState
zowe ops-mvs get ssm-current-state $resource $table

You can also use Zowe to disable any rules that might misbehave when my test resource goes down and re-enable them after my test is done.

zowe ops-mvs disable rule $testRuleset $testRule --subsystem $mySys
zowe ops-mvs enable rule $testRuleset $testRule --subsystem $mySys

By incorporating these OPS commands into your off-platform automation tests, you can leverage off-platform build tools for managing your build process without forfeiting the existing automation you have in OPS or the z-specific tools that it gives you.

Finally, let’s take a look at a simple bash example I wrote. I bring up a test resource and poll to ensure that it was successfully brought up. Rewriting in a language more useful than bash is an exercise left to the reader 😉

#!/usr/bin/env bashset +x# Globalstries=10wait=3tests=2# Define our test functionfunction  demoCICD() {  resource="TESTSTC"  table="CICD"  startCommand="zowe ops-mvs set ssm-desired-state $resource $table --current DOWN --new UP"  pollCommand="zowe ops-mvs get ssm-current-state $resource $table"  echo $startCommand  eval $startCommand  echo ''  counter=0  state=""  desired="Resource $resource has Current_State UP"  while (("$counter" < $tries)) && [[ ! $state =~ UP ]]  do    ((counter++))    echo $pollCommand    state=$(eval $pollCommand)    echo ''    sleep $wait  done  if [ "$state" == "null" ]; then    echo 'Request timed out'    echo ''    exit 1  elif [[ ! $state =~ UP ]]; then    echo $resource "failed to change state"    echo ''    exit 1  else    echo 'Task' $resource 'successfully brought up'  fidemoCICD

For more information about the CA OPS/MVS Plug-in for Zowe CLI, see the techdocs page.

Dan’s post: Mainframe & Assembler Zowe: “Hello World” Example

Learn more about Zowe at this site; more Zowe blogs here

--

--

Jack Hartzler
Zowe
Writer for

Software Engineer out of UCSD, now at Broadcom in VA