Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run multiple just rules in parallel

Tags:

just

I would like to run all dependent rules in my justfile to run in parallel. How do I do this?

pull-all: pull-a pull-b

pull-a:
    docker pull a

pull-b:
    docker pull b

When I run just pull-all, just runs the two dependents pull-a and pull-b sequentially, in the order they are listed after pull-all:.

Is there a way to tell just to run both of them at the same time in parallel?

I looked at the documentation but couldn't find any mention of "parallel" and only one mention of "order".

like image 380
Cornelius Roemer Avatar asked Oct 17 '25 21:10

Cornelius Roemer


2 Answers

As of Just 1.42, you can use the [parallel] attribute to run a recipe's dependencies in parallel.

For the OP example,

[parallel]
pull-all: pull-a pull-b

pull-a:
    docker pull a

pull-b:
    docker pull b
like image 161
jonaslb Avatar answered Oct 20 '25 03:10

jonaslb


It is not yet supported, but there is a feature request (and an open PR).

Two other things that you may want to investigate:

  • https://github.com/Nukesor/pueue
  • https://taskfile.dev/usage/#task-dependencies
like image 30
Jonathan Hult Avatar answered Oct 20 '25 05:10

Jonathan Hult