gradle-docker-compose-plugin icon indicating copy to clipboard operation
gradle-docker-compose-plugin copied to clipboard

Allow exposeAsEnvironment and exposeAsProperties to be independent of ComposeUp

Open cwensel opened this issue 9 months ago • 2 comments

I sometimes run ComposeUp/ComposeDownForce from an init script.

for example, running spring boot bootRun, I want to embed the port/host information in the config files.

from and Ide, i already parse the serviceInfos json. having gradle parse and make them available would be useful.

cwensel avatar Sep 29 '23 20:09 cwensel

Could you please elaborate more on this feature request?

augi avatar Dec 21 '23 21:12 augi

From what I can tell, the ServiceInfo map is populated when ComposeUp runs (and metadata is written to the build dir), but if it's run from an init script, and then the normal gradle build is run (over and over), the metadata in the serviceinfos files is not read and parsed.

The result is neither exposeAsEnvironment nor exposeAsProperties create env or property values, as they weren't faulted from disk into the cache.

fwiw, my unit tests look for these files so service/host and port mapping can be done, but having the expose* capabilities working in the build file would be great.

cwensel avatar Dec 21 '23 22:12 cwensel