nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.4k stars 2.33k forks source link

`run-many` order #6182

Closed j closed 3 years ago

j commented 3 years ago

Description

I'd like the ability to run a specific target match last.

Motivation

I have an API gateway that needs to run after all other services are running. Right now nx chooses the gateway first and it fails to launch due to how Apollo Federation works.

FrozenPandaz commented 3 years ago

The order of run-many is based on the dependencies between projects. If you need a project which needs to wait for all other projects, you can specify that the project implicitly depends on other projects using Implicit Dependencies.

If you want to start up the API Gateway and knowing it depends on starting its dependencies: Having configured it with the above, you can set a Target Dependency that tells the API Gateway to also need the serve of its dependencies.

Alternatively, you can exclude the API Gateway from the run-many by passing --exclude api-gateway. Then, run nx serve api-gateway afterwards.

If these don't make sense, I recommend joining the Community Slack channel where someone can help you more synchronously than a Github Issue. http://go.nrwl.io/join-slack

j commented 3 years ago

Yup, I did the later one you mentioned. I’ll try the other methods. I now ping the services in the gateway in development to wait until they are live.

On Mon, Jul 5, 2021 at 3:07 PM Jason Jean @.***> wrote:

Closed #6182 https://github.com/nrwl/nx/issues/6182.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nrwl/nx/issues/6182#event-4980206343, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEP4YVS4JFNOTEYMY7N24DTWIUJRANCNFSM47Q6TAMQ .

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.