Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor
top1
top1



Tip

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


Expand
titlePrerequisite
  • 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.



Expand
titleStep1: 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: 
Code Block
languagebash
themeConfluence
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:
Code Block
languagebash
themeConfluence
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


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

"enableWebHookEngine" : true

}

Code Block
languagebash
themeConfluence
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:
Code Block
languagebash
themeConfluence
nohup java -jar PlatformEngine-<version>.jar 
  • The logs will be available at $INSIGHTS_HOME/logs/PlatformEngine 


Expand
titleWebHook Agent Configuration

Please refer WebHook Agent Configuration for more detail


Back to Top