Login to Jenkins console
Open the job and click on the configuration
Add post-build step of type “Execute Shell” and select “Run only if the build succeeds”
Enter the below script and click on - Change the dispatcher hostname accordingly.
/usr/bin/curl -H "CQ-Action: DELETE" -H "CQ-Handle:/" -H "Content-Length: 0" -H "Content-Type: application/octet-stream" --noproxy .com http://<<dispatcher host name>>/dispatcher/invalidate.cache
If multiple dispatchers is configured then configure the dispatchers as shown below in the script.
/usr/bin/curl -H "CQ-Action: DELETE" -H "CQ-Handle:/" -H "Content-Length: 0" -H "Content-Type: application/octet-stream" --noproxy .com http://{dispatcher1, dispatcher2, dispatcher3, dispatcher4}.com/dispatcher/invalidate.cache
No comments:
Post a Comment
If you have any doubts or questions, please let us know.