WORKLOAD AUTOMATION COMMUNITY
  • Home
  • Blogs
  • Forum
  • Resources
  • Events
    • IWA 9.5 Roadshows
  • About
  • Contact
  • What's new

HWA-GIT-SNOW Integration: Application Code Promotion and Scheduling Objects Promotion Orchestration

9/2/2021

0 Comments

 
Picture
This Blog aims to showcase how a Company using HWA and maintaining all its Application Code on GIT alongwith all Scheduling Objects could also promote and manage the entire Code Promotion using HWA while also tracking the Whole Process on Service Now.
We consider that the Customer has three Code Repositories called QA_Repo , PREPROD_REPO ,PROD_Repo .Customer would promote his Application Code+Scheduling Objects from QA_Repo to PREPROD_Repo or alternatively from PREPROD_Repo to PROD_Repo .

A Request is placed on Service Now by the relevant Application Team whenever they have to promote all the Application Code+Scheduling Objects from one Environment to the other .
The Code Promotion of the Application Code+Scheduling Objects is completely orchestrated in HWA End to End and also tracked on Service Now.
​
Consider that the below request is raised on Service Now by the Inventory planning Team needing to promote their Application Code+All Scheduling Objects relevant to Inventory Planning from PRE-PROD ENV to PROD ENV :
Picture

Fig 1


The request raised on Service Now has a Field called Automation which is set to “YES” to indicate this is a request to be processed through HWA. It is raised to the Assignment group : GIT_Code_promote and the description Field in the Request has the Application Name mentioned as InvPlanning colon separated by the Source ENVName and Destination ENV Name as “InvPlanning:PREPROD_Repo:PROD_Repo”.

Solution Realization:

SERVICENOW_GET_REQUESTS_GITREQUEST Job:

​The job would be a RESTFUL GET Job that would read the details on the Ticket from Service Now and would store the details on the Ticket in an output file called /tmp/requestsgitcodeprmoutput .
Picture
Fig 2

EXTRACT_REQUEST_TKTNO_GITREQUEST Job :

​This Job would be a Unix Job which would Extract the Ticket Number from the Output File /tmp/requestsgitcodeprmoutput . ​
Picture
Fig 3

EXTRACT_REQUEST_SOURCEENV_GITREQUEST Job:
​

This is a Unix Job which would extract the Source Environment from the Output File /tmp/requestsgitcodeprmoutput .
Picture
Fig 4

EXTRACT_REQUEST_TARGETENV_GITREQUEST Job:

This is a Unix Job which would extract the Target Environment from the Output File /tmp/requestsgitcodeprmoutput .
Picture
Fig 5

STORE_TKTNO_GITREQUEST Job:

This Job uses the jobprop utility of HWA to store the Ticket Number(internally referred to in SNOW as the sys_id) into a HWA variable called TKTNO:
Picture
Fig 6

GIT-SETCONFIG Job:

This would be a Unix job to set the Global Config for UserName and Email:
Picture
Fig 7

​
GIT_INIT_2 Job:
​

This job initializes the GIT Repo locally:
Picture
Fig 8

GIT_PULL_PPREPO Job:

The Job pulls the Application Code and Scheduling Objects stored in the PrePROD Repo into the Local Repository , we have Similar Jobs : GIT_PULL_QAREPO:
Picture
Fig 9

GIT_BRANCH_PPREPO Job:

This job checks out and creates a new branch called testhwa from the existing branch called master . Likewise we have a similar job called GIT_BRANCH_QAREPO.
Picture
Fig 10

GIT_ADD_2 Job:

The Job GIT_ADD adds all application Code+Full Dump of HWA Scheduling Objects to the local Repository:
Picture
Fig 11

GIT_REMOTE_ADD_PRODREPO Job:

The Job does a remote add to the GIT Repo PROD_Repo from the Repository PREPROD_Repo:
Picture
Fig 12

GIT-COMMIT-ADD Job:

The Job GIT-COMMIT-ADD does a commit on Code and Scheduling Objects Definitions to be promoted into the PROD ENV:
Picture
Fig 13

GIT_PUSH Job:

The GIT Push Job would push the Application Code and Scheduling Objects Definitions to the target PROD Repo on GIT and would pass conditional dependencies PUSHSUCCEDDED(RC=0) incase the promotion of Application Code+Scheduling Objects was Successful else would return PUSHFAILED (RC>0 non-Zero Return Code) to indicate that the push was not Successful.
Picture
Fig 14
Picture
Fig 15

Likewise we have similar GITPush jobs called GIT_PUSH_PREPROD_REPO for the other Flow to promote from QA to Preprod.
 
Here’s the Jobstream once it is fully developed to include two branches from QA to PRE-PROD and from PRE-PROD to PROD depending on the input in the Service Now Request :
 
SNOW_GITREQUEST_TICKET_CLOSE Job:

The SNOWGITREQUEST_TICKET_CLOSE job closes the Ticket in Question , the TKTNO Variable is passed to this job and it makes a RESTFUL call into SNOW to close the Request in question.
Picture
Fig 16
Picture
Fig 17

We have conditional dependencies defined depending on the inputs in the SNOW Request which could be Source ENV : PRE-PROD to Target ENV : PROD or Source ENV : QA to Target ENV : PROD , likewise two Flows Branch out from these two jobs one to promote Application Code+Scheduling Objects from Pre-PROD to PROD or from QA to PreProd:
Picture
Fig 18

Each of the two Flows would run : GIT Init , GIT Set Config , GIT Pull Repo , GIT New Branch , GIT Add , GIT Remote Add , GIT Commit and GIT Push Steps .
Picture
Fig 19

Conditional Dependencies are defined from the GIT Push Steps called PUSHSUCCEDDED and PUSHFAILED.
Picture
Fig 20

A Join Dependency defines an OR Condition that gets satisfied when one of the GIT Push jobs in one of the Flows passes PUSHSUCCEDDED Condition .
 
The Whole flow when executed against this request would run as follows:
Picture
Fig 21
Picture
Fig 22

The Flow which gets executed depending on the conditional dependencies from Source ENV and Target ENV Jobs would run while the other Flow would get suppressed.
 
Conclusions from the UseCase :
In any Customer Environment the Application Code and HWA Objects Definitions need to be maintained in a Code Repository like GIT and the promotion from one Environment to another can be managed entirely out of HWA and there is no need of any external manual steps while tracking the promotion on Service Now for approval as well.

Authors Bio
Picture
​Sriram V, ​Senior Technical Lead
​

Sriram is working with Workload Automation for the last 12+ years. Started out as a Scheduler, later as an Administrator, SME and India SME of the Product. He has been part of the Product Team in the last few years supporting Workload Automation on SaaS before moving to the Lab Services and Tech Sales of WA.
View my profile on LinkedIn
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Archives

    March 2023
    February 2023
    January 2023
    December 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    June 2020
    May 2020
    April 2020
    March 2020
    January 2020
    December 2019
    November 2019
    October 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    October 2017
    September 2017
    August 2017
    July 2017
    June 2017
    May 2017

    Categories

    All
    Analytics
    Azure
    Business Applications
    Cloud
    Data Storage
    DevOps
    Monitoring & Reporting

    RSS Feed

www.hcltechsw.com
About HCL Software 
HCL Software is a division of HCL Technologies (HCL) that operates its primary software business. It develops, markets, sells, and supports over 20 product families in the areas of DevSecOps, Automation, Digital Solutions, Data Management, Marketing and Commerce, and Mainframes. HCL Software has offices and labs around the world to serve thousands of customers. Its mission is to drive ultimate customer success with their IT investments through relentless innovation of its products. For more information, To know more  please visit www.hcltechsw.com.  Copyright © 2019 HCL Technologies Limited
  • Home
  • Blogs
  • Forum
  • Resources
  • Events
    • IWA 9.5 Roadshows
  • About
  • Contact
  • What's new