GoogleCloudPlatform / cloud-code-intellij

Plugin to support the Google Cloud Platform in IntelliJ IDEA - Docs and Issues Repository
Apache License 2.0
318 stars 59 forks source link

Configure dev mode in "Cloud Code: Kubernetes" run configuration (enable auto-sync) #3184

Open simonstratmann opened 4 months ago

simonstratmann commented 4 months ago

We use skaffold, helm and jib to deploy our Spring Boot application. When using the auto-sync functionality the whole image is build and deployed. In our case it would be enough to sync the files and jars as that triggers the SB devtools to automatically reload the application.

I got this working by runing skaffold dev --auto-build=false --auto-deploy=false --auto-sync=true in the terminal so that on a build the changed files are transferred to the container and the application is automatically restarted. I haven't found a way to achieve this when using the run configuration.

The default auto-sync with jib seems a bit over-eager so that it builds and deploys the image when actually syncing the class files and jars would be enough. I have enabled "On demand" and on a rebuild the auto-sync would then sync the changed files.

The command run by the run configuration is this: skaffold.exe dev --filename skaffold.yaml --label ide=cloudcodeintellij --auto-build=false --auto-deploy=false --auto-sync=false --rpc-port 50051 --port-forward=true --wait-for-deletions-max=2m0s --status-check=true. I would like to actually enabled auto-sync in this case.

Additional Information

simonstratmann commented 4 months ago

I tried fixing this by using environment variables but this is overwritten by the command line