monamona
monamona

Reputation: 1246

Run Configurations for Spring Service and Batch script in IntelliJ

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?

Upvotes: 0

Views: 721

Answers (0)

Related Questions