0

I have a shell script that forwards a port from a kubernetes cluster of our testing cluster. It has a postgres database that I need for my spring application to work.

Now, call me lazy (and make me a compliment in the progress), but I want to click once, start my shell script and keep it running while the spring service starts up.

I currently have two run configs:

enter image description here

with the bat file that contains only one line: (Don't blame me for the skip tls please...)

kubectl port-forward service/postgresql 5432 -n yugabyte --insecure-skip-tls-verify

I also have the standard Spring boot run config:

enter image description here

Now, I usually would go and use this "Run another configuration" before it starts.

enter image description here

The problem I have with this, is that the script never finishes. It is a port forward that works as long as the command is running in the shell, when it is finished, the port forwarding stops to work. I don't want to use start /b as a prefix for my shell command because that causes it to not be closable anymore, and I don't want my port to be forwarded all the time, just when I start my application. Is there any way to let a configuration run in parallel while my service is running? Or can I somehow else configure intellij to do this?

monamona
  • 1,195
  • 2
  • 17
  • 43
  • Does https://www.jetbrains.com/help/idea/run-debug-multiple.html#compound-configs help? – CrazyCoder Jun 05 '23 at 14:43
  • Yes and no... it does what I want, however the batch job is not terminated when my service terminates. – monamona Jun 05 '23 at 17:49
  • You will need to handle it in the batch script or in some other way. – CrazyCoder Jun 05 '23 at 18:00
  • So far, so good. That's what my main doubts are, if that is possible at all. However thanks for the tip with the Compound configuration, thats already a major improvement to my situation :) – monamona Jun 05 '23 at 18:03

0 Answers0