[Reactive-cli][Lagom][sbt][sbt-plugin] Trigger a task when all the sub-projects have finished a task


(Jules Ivanic) #1

Hi everyone,

I’m trying to build a mini plugin that help working with the rp tool (from the reactive-cli) in a Lagom/sbt project.

I already have a generateServiceResources task that generates for each service, the service declaration (yaml) file.
For now, this task is triggered after the docker:publishLocal task and also after the docker:publish thanks to this code in the projectSettings:

  (Docker / publish) := {
    Def
      .sequential(
        Docker / publish,
        generateServiceResources
      )
      .value
  },
  (Docker / publishLocal) := {
    Def
      .sequential(
        Docker / publishLocal,
        generateServiceResources
      )
      .value
  },

Now, I need to add a generateIngressResources that will generate the ingress(es) needed for the project.
This task is already implemented but I now have to trigger it when all the docker:pulishLocal (or docker:pulish) have finished to run.

Is it possible to do this ? if yes, how ?

The plugin is open-source. It’s still very a WIP but you can look at the code, make comments and/or PR here: https://github.com/Colisweb/sbt-rp

Thanks for your help,
Jules