Sample build script using Endevor Zowe Cli

book

Article ID: 220392

calendar_today

Updated On:

Products

CA Endevor Software Change Manager (SCM) CA Brightside

Issue/Introduction

Installed Endevor Zowe Cli, looking for sample build script to get an idea on how to enable Endevor build automation.

 

Environment

Release : 18.1

Component : CA Endevor Software Change Manager

CA Brightside 3.0

Resolution

Sample Jenkins groovy script using Endevor Zowe Cli:

node {
   stage('Code Scan') {
       echo 'Scanning updated programs'
       sh 'zowe endevor retrieve element "*" --env DEV --sn 1 --sys FINANCE --sub ACCTREC --typ COBPGM --to-dir "C:\\codescan" -i ENDEVOR --nsign'
       sh '"C:\\Program Files (x86)\\Jenkins\\tools\\hudson.plugins.sonar.SonarRunnerInstallation\\Scanner\\bin\\sonar-scanner.bat" -Dsonar.host.url=http://my.sonar.qube.server.host.name:9000 "-Dsonar.projectBaseDir=C:\\codescan"'
   }
   stage('Build') {
       echo 'Building progam updates'
       sh 'zowe endevor generate element "*" --env QA --sn 1 --sys FINANCE --sub ACCTREC --typ COBPGM -i ENDEVOR --where-ccid-current ${CCID} --ccid ${CCID} --comment Jenkins_Build'
       sh 'zowe endevor generate element "*" --env QA --sn 1 --sys FINANCE --sub ACCTREC --typ LNK -i ENDEVOR --where-ccid-current ${CCID} --ccid ${CCID} --comment Jenkins_Build'
   }
   stage('Tests') {
       echo 'Updating test region'
       sh 'zowe jobs submit data-set "MYHLQ.APP.JCL(SLICKDPL)" --wfo --vasc'
       echo 'Executing CA Verify tests'
       sh 'zowe jobs submit data-set "MYHLQ.APP.JCL(TEST)" --wfo --vasc'
   }
   stage('Package') {
       echo 'Packaging code for promotion'
       sh 'zowe endevor create package ${PKGNAME} -d "Package for CCID ${CCID}" -i ENDEVOR --novalidate-scl --ft "SET OPTIONS CCID ${CCID} COMMENT ${CCID} . "'
       sh 'zowe endevor list elements --env QA --sn 1 --sys FINANCE --sub FINANCE --typ "*" -i ENDEVOR --where-ccid-current ${CCID} --to-package ${PKGNAME} --scl-action MOVE'
       sh 'zowe endevor cast package ${PKGNAME} -i ENDEVOR'
   }
   stage('Promote') {
       echo 'Promoting code'
       sh 'zowe endevor execute package ${PKGNAME} -i ENDEVOR'
   }
}