In this Blog , we would go through a UseCase to demonstrate a Customer wanting to Track his Application Deployment through Service Now uses HWA to accomplish the same while also orchestrating the entire flow of Application Deployment and Service Now Ticketing Orchestration through HWA : Requirement :
Fig 1 Solution Conceptualization in HWA :
Implementation : For the above Usecase , we are making use of a Service Now Instance on SaaS with Administrator Role and having the below experience and View built in the table for Request Management : Fig2 Fig3 SERVICENOW_GET_REQUESTS_CONTBUILD Job : This is a RESTFUL GET job which makes a call to the URL https://dev114719.service-now.com/api/now/table/x_650167_requests_requests and query by descending order and Assignment Group Name server_build_team and Automation Flag marked as “YES” and picks the latest Request in the queue and stores the JSON response retrieved from the request in the output file /tmp/requestsserverbuildoutput . Fig4 EXTRACT_REQUEST_APPLSERVER_CONTBUILD Job : This is a Unix Job which would extract the Application Server to be deployed as part of the Deployment from the output file /tmp/requestsserverbuildoutput and display it in the joblog output. EXTRACT_REQUEST_DB_CONTBUILD Job : This is a Unix Job which would extract the DB Name to be deployed as part of the Deployment from the output file /tmp/requestsserverbuildoutput and display it in the joblog output. EXTRACT_REQUEST_TKTNO_CONTBUILD Job : This is a Unix Job which would extract the Ticket Number of the Request from the output file /tmp/requestsserverbuildoutput and display it in the joblog output. EXTRACT_REQUEST_APPLNAME_CONTBUILD Job : This is a Unix Job which would extract the Application Jar File Name from the Output File /tmp/requestsserverbuildoutput and display it in the joblog output. EXTRACT_REQUEST_APPLPATH_CONTBUILD Job : This is a Unix Job which would extract the Application Jar Path from the Output File /tmp/requestsserverbuildoutput and display it in the joblog output. Fig5 STORE_APPLSERVERNAME_CONTBUILD Job : This is an executable job type which parses the EXTRACT_REQUEST_APPLSERVER_CONTBUILD Joblog output and uses the jobprop utility to set a HWA variable for Application Server Name .There are also two Output conditions which are passed through the Job called “APACHE” which is passed when the Joblog contains the String “Apache” and the condition “NGINX” which is passed when the Joblog contains the String “nginx” . Fig6 Fig7 STORE_DB_CONTBUILD Job : This is an executable job type which parses the EXTRACT_REQUEST_DB_CONTBUILD job’s Joblog output and uses the jobprop utility to set a HWA variable for DBName .There are also two Output conditions which are passed through the Job called “MONGO” which is passed when the Joblog contains the String “Mongo” and the condition “POSTGRE” which is passed when the Joblog contains the String “Postgre” . Fig8 Fig9 STORE_APPLNAME_CONTBUILD Job : This is an executable job type which parses the EXTRACT_REQUEST_APPLNAME_CONTBUILD Job’s Joblog output and uses the jobprop utility to set a HWA variable for APPLNAME extracting the jar filename in the Variable. Fig10 STORE_APPLPATH_CONTBUILD Job : This is an executable job type which parses the EXTRACT_REQUEST_APPLPATH_CONTBUILD Job’s Joblog output and uses the jobprop utility to set a HWA variable for APPLPATH extracting the Path to the jar file to be deployed. Fig11 STORE_TKTNO_CONTBUILD Job : This is an executable job type which parses the EXTRACT_REQUEST_TKTNO_CONTBUILD Joblog output and and uses the jobprop utility to set a HWA variable for Ticket No/Request No in a variable named TKTNO : Fig12 VT_UPDATE_SNOW_CONT_USECASE Job : This is a Variable table update Job which would update the variable table SNOW_CONT_USECASE set at the Jobstream Level with the HWA Variables : APPLPATH set to ${job:EXTRACT_REQUEST_APPLPATH_CONTBUILD.stdlist} , APPLNAME set to ${job:EXTRACT_REQUEST_APPLNAME_CONTBUILD.stdlist} , TKTNO set to ${job:EXTRACT_REQUEST_TKTNO_CONTBUILD.stdlist} so that the Application Jar Path , Application Jar File Name and Ticket Number is extracted readily . Fig13 DEPLOY_APPL_YAML Job : This is a Unix job which would take APPLPATH and APPLNAME as input and build a yaml file/Docker File for the Java Application to be deployed . Fig14 DEPLOY_APPL_DOCKER Job : This is a Unix job which would deploy the jar Application taking the Application Name(jar file name) as input and deploying a Dockerized Instance of the Application through the Docker File built in the previous step . Fig15 DEPLOY_MONGODB_DOCKER Job : This job would run when the condition MONGO is passed from the STORE_DB_CONTBUILD Job ,this deploys a Mongo DB Containerized Instance through docker run command : Fig16 DEPLOY_POSTGRESQLDB_DOCKER Job : This Job would run when the condition POSTGRE is passed from the STORE_DB_CONTBUILD Job , this deploys a Containerized Instance of Postgre SQL DB through a Docker run command : FIg17 DEPLOY_NGINX_DOCKER Job : This Job would run when the condition NGINX is passed from the STORE_APPLSERVERNAME_CONTBUILD Job , this deploys a Containerized Instance of an Nginx through a Docker run command : Fig18 DEPLOY_APACHE_DOCKER JOB : This Job would run when the condition APACHE is passed from the STORE_APPLSERVERNAME_CONTBUILD Job , this deploys a Containerized Instance of an Apache through a Docker run command : Fig19 DBDEPLOY Join Condition : This is satisfied when one of the DB Deployment Jobs : Mongo DB or PostgreSQL DB finishes Successfully : Fig20 APPLDEPLOYFAILED Join Condition : This is satisfied when one of the AppServer deployment Jobs : Apache Deploy Job or Nginx Deploy Job or MongoDB Deploy Job or Postgre SQL Job or Application Deploy Docker Job finishes in Abend : Fig21 APPSERVER Join Condition : This is satisfied when one of the AppServer deployment Jobs : Apache Deploy Job or Nginx Deploy Job finishes Successfully : Fig 22 SNOW_UPDATE_TICKET_CONTBUILD Job : This is RESTFUL Job which would post the Update to the Request/Ticket taking the Variable TKTNO as input making a call to the REST URL https://dev114719.service-now.com/api/now/table/x_650167_requests_requests/^TKTNO^ which would post the message "Application , DB and Middleware Deployment Successful" into comments section of the Ticket/Request . This job would run only when the DEPLOY_APPL_DOCKER Job finishes Successfully , DBDEPLOY Join Condition , APPSERVER Join Condition are satisfied : Fig23 Fig24 SNOW_CONTBUILD_TICKET_CLOSE Job : This is a RESTFUL Delete job which would take the TKTNO as input and do a RESTFUL Delete against the Request No/Ticket No in question : Fig25 SNOW_UPDATE_TICKET_NEGCOND_CONTBUILD Job : The Job SNOW_UPDATE_TICKET_NEGCOND_CONTBUILD runs when the APPLDEPLOYFAILED Join Condition is satisfied (one of the AppServer deployment Jobs : Apache Deploy Job or Nginx Deploy Job or MongoDB Deploy Job or Postgre SQL Job or Application Deploy Docker Job finishes in Abend) . This is a RESTFUL PUT Job which would post the comment : "Application Deployment Failed" in the comments section of the Request/Ticket : Fig26 Fig27 A Snapshot of the complete Jobstream when executed attached below : Fig28 Fig29 Conclusions from the UseCase :
Authors Bio
0 Comments
Your comment will be posted after it is approved.
Leave a Reply. |
Archives
March 2023
Categories
All
|