Create Repository Specific Turborepo Pipelines

Share this video with your friends

Send Tweet
Published 5 months ago
Updated 4 months ago

It's fairly straight forward to create repo specific pipelines with Turborepo. The script goes like this: {monorepo-name}/{repository}#{script-name}. For example, if we wanted to run the typecheck command in just the dashboard repo, it would look like this: @monorepo/dashboard#typecheck. Lastly, we will make sure that it dependsOn the utils#typecheck pipeline.

Instructor: [0:00] Let's create a contrived example here. Let's imagine that we only want to run the typecheck pipeline in the dashboard project after the typecheck pipeline has run in the utils package. [0:17] We can do that by adding an all pipeline, so we're going to call it monorepo_dashboard, then hash, and we're going to say typecheck. This configuration will only apply for the dashboard project when we try to run the typecheck pipeline.

[0:39] Now, let's add the dependsOn array and we're going to say that this pipeline depends on the monorepo utils typecheck pipeline.

[0:56] Let's run the typecheck pipeline again. As you can see, it is started with utils typecheck then block typecheck. Until utils typecheck is done, we start running typecheck in dashboard.

[1:13] To recap, we can get as specific as we want with pipelines. We just need to specify a pipeline with the name of the project that we want and then add the hash symbol and then add the name of the pipeline that we want to modify.