Installing Webhook Subscriber and Webhook Engine
- Surbhi Gupta (Unlicensed)
- Abirami
- Gaurav (Unlicensed)
Step - by - step guide on how to Install Insights Advanced - Webhooks
- 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.
- Download the PlatformInsightsWebHook jar from https://github.com/CognizantOneDevOps/Insights/releases/download/v9.2/PlatformInsightsWebHook-9.2.jar and store it in one folder
- Download webhook_subscriber.properties file using link webhook_subscriber.properties and place it inside $INSIGHTS_HOME\.InSights
- Open webhook_subscriber.properties and Edit properties if you want
- Run the downloaded jar using the command:
java -jar PlatformInsightsWebHook.jar
Example: java -jar PlatformInsightsWebHook.jar
- If you want to run the jar as a background service instead, use the below command:
nohup java -jar PlatformInsightsWebHook.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
- create folder webhook1 , add PlatformInsightsWebHook.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
- 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
- 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
- Set flag as true for WebhookEngine in "server-config.json" as mentioned below:
{
"enableWebHookEngine" : true
}
- Download the PlatformEngine jar from the URL: https://github.com/CognizantOneDevOps/Insights/releases/download/v9.2/PlatformEngine-9.2.jar
Rest Service URL: https://github.com/CognizantOneDevOps/Insights/releases - Run the downloaded jar using the command:
java -jar PlatformEngine.jar
Example: java -jar PlatformEngine.jar
- If you want to run the jar as a background service instead, use the below command:
nohup java -jar PlatformEngine.jar
- The logs will be available at $INSIGHTS_HOME/logs/PlatformEngine
Please refer WebHook Agent Configuration for more detail
Back to Top
©2021 Cognizant, all rights reserved. US Patent 10,410,152