Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 20 Next »


Step - by - step guide on how to Install Insights Advanced - Webhooks

 Prerequisite
  • Environment variable INSIGHTS_HOME and server-config.json. 
    • Windows: Server 2 - SetEnvVariables.bat
    • Linux: insights_first.sh
  • Java
  • Apache-Tomcat
  • Set the flag "showWebhookConfiguration" to true in uiconfig.json
  • Set webhookHost to the path where your PlatformInsightsWebHook deployed,
    • if you have  single instance of webhook then your host name is <protocol>://<hostname>:<port> ex "http://localhost:8981"
    • if you have multiple instance of webhook then keep only host name to it  <protocol>://<hostname> ex "http://localhost" and create url at runtime 
  • Set flag "enableWebHookEngine" to true  in "server-config.json"

Refer here for installation steps if required.


 Step1: Run PlatformInsightsWebHook

          (The above link is nexus enterprise repository which is restricted with user credentials. Use authorized credentials or contact DevOpsPlatformSupport@cognizant.com )

  • Download webhook_subscriber.properties file using link  webhook_subscriber.properties  and placed in same folder where jar is located
  • Open webhook_subscriber.properties and Edit  properties if you want 
  • Run the downloaded jar using the command: 
java -jar PlatformInsightsWebHook-<version>.jar

Example: java -jar PlatformInsightsWebHook-0.1.jar

  • If you want to run the jar as a background service instead, use the below command:
nohup java -jar PlatformInsightsWebHook-<version>.jar &
  • The logs will be available at $INSIGHTS_HOME/logs/PlatformInsightsWebHook 

    Multiple instance of Webhook 

 If you want to run multiple instance of webhook then use following steps

  1. create folder webhook1 , add PlatformInsightsWebHook-<version>.jar and webhook_subscriber.properties in it . Open webhook_subscriber.properties and edit server.port and set unique port in it example 8981 and server.servlet.context-path with unique path /PlatformInsightsWebHook (unique value as per application )  Sample Webhook URL for this instance http://<HostIP>:8981/PlatformInsightsWebHook/insightsDevOpsWebHook?webHookName=git_webhook1_commit
  2. create folder webhookGIT , add PlatformInsightsWebHook-<version>.jar and webhook_subscriber.properties in it . Open webhook_subscriber.properties and edit server.port and set unique port in it example 8982 and server.servlet.context-path with unique path /PlatformInsightsWebHookGIT (unique value as per application )Sample Webhook URL for this instance http://<HostIP>:8982/PlatformInsightsWebHookGIT/insightsDevOpsWebHook?webHookName=git_wb2_push
  3. if your server run behind Apache Httpd then Open Apache httpd conf file (httpd-vhosts.conf)  and add following block each for one webhook instance 

<Proxy balancer://wbhome>
BalancerMember http://localhost:8981
ProxySet lbmethod=bybusyness
</Proxy>
<Location /webhook>
Order allow,deny
Allow from all
ProxyPass balancer://wbhome stickysession=JSESSIONID
</Location>

<Proxy balancer://wbhomeGIT
>
BalancerMember http://localhost:8982
ProxySet lbmethod=bybusyness
</Proxy>
<Location /webhookGIT>
Order allow,deny
Allow from all
ProxyPass balancer://wbhomeGIT stickysession=JSESSIONID
</Location>

Restart Apache httpd server 

your proposed webhook url will be 

 http://<HostIP>/webhookGIT/PlatformInsightsWebHookGIT/insightsDevOpsWebHook?webHookName=git_wb2_push

http://<HostIP>/webhook/PlatformInsightsWebHook/insightsDevOpsWebHook?webHookName=git_webhook1_commit

Use this url in your tool.


If you want to register webhook service , Please add paramenter -config.file.location=<location of config file> ,

on windows you can do like this  

C:\InSights\Insights_Deployment\Server2\nssm-2.24\win64\nssm install InSightsWebhookSubscriber "%JAVA_HOME%\bin\java.exe" "-jar C:\InSights\Insights_Deployment\Server2\Configs\WebhookJar\PlatformInsightsWebHook.jar" -config.file.location=C:\InSights\Insights_Deployment\Server2\Configs\WebhookJar


 Step2: Run PlatformWebhookEngine
  • Set flag as true for WebhookEngine in "server-config.json" as mentioned below:
          

"enableWebHookEngine" : true

}

java -jar PlatformEngine-<version>.jar

Example: java -jar PlatformEngine-0.1.jar

  • If you want to run the jar as a background service instead, use the below command:
nohup java -jar PlatformEngine-<version>.jar 
  • The logs will be available at $INSIGHTS_HOME/logs/PlatformEngine 

Back to Top

  • No labels