gradle-dcompose-plugin icon indicating copy to clipboard operation
gradle-dcompose-plugin copied to clipboard

Feature Request: Add support for composite build

Open GeorgHoffmeyer opened this issue 4 years ago • 3 comments

Is there support for composite build planed, i.e. starting one container from a different build?

GeorgHoffmeyer avatar Oct 14 '20 15:10 GeorgHoffmeyer

How would that be achieved? Are you talking about the composite builds from Gradle?

chrisgahlert avatar Oct 15 '20 07:10 chrisgahlert

Yes, I mean the composite-build in gradle. At the moment I can use a composite-build, but I have to define all service dependencies as task dependencies. instead of

dcompose {
  myService {
    ...
    dependsOn myService2
  }
}

I have to use

startMyServiceContainer  dependesOn gradle.includedBuild('project2').task(':startMySerice2Container')

Also it is necessary to define an external network or otherwise every "startContainter" would kill the running containers.

GeorgHoffmeyer avatar Oct 15 '20 07:10 GeorgHoffmeyer

Okay, so I'm guessing it could look something like this:

dcompose {
  myService {
    ...
    dependsOn = [ service(':project2:myService2') ]
  }

  substituteService(':project2:myService2') {
    // use a fallback image from a remote repo if the service is not present in the current build
    image = '...' 
  }
}

I'm afraid I don't have the time right now, to do the implementation. But I'd be happy to accept a PR for this :)

chrisgahlert avatar Oct 15 '20 08:10 chrisgahlert