(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
- 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
- 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