2

I have a minishift setup running in my local and now I brought a tomcat container up with few war files in it. Now I have a script in /usr/local/tomcat/bin folder. I need to run the script and I am posting a curl request to fetch something from the war deployed. Issue1: I am not able to use post deployment lifecycle hook as it just creates a copy of the pod and the container is still not started, so I cannot make use of the war deployed to access the app service. Let me know if there is a way to execute the script inside the container. I am trying with tasks and cronjob, let me know if that will work.

Thanks in advance.

Arun
  • 21
  • 2
  • Can you provide a more concrete example of what you need to do, and what you've tried already? – David Maze Nov 18 '20 at 01:00
  • Hi David 1) So I have a tomcat container running with an application deployed in webapps already and I have a script named initscript.sh in the bin folder inside the tomcat server. 2) The initscript does an API call to the rest api defined insided the war file deployed in the tomcat server. So now I have to bring the tomcat server and then I have to run the initscript. Let me know if this is still not clear. – Arun Nov 18 '20 at 05:43
  • Hi Arun, I think you are looking for command in DeploymentConfig. Pls check this one https://docs.openshift.com/container-platform/3.3/dev_guide/deployments/basic_deployment_operations.html#executing-commands-inside-a-container-deployments – sharmag Nov 18 '20 at 10:17
  • Hi Sharmag, Actually, I want the script to be executed after deployment, because it has a functionality to call an api defined inside the application in the tomcat. – Arun Nov 18 '20 at 14:56

0 Answers0