You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a few use cases for executing multiple targets:
Executing some targets in parallel, some sequentially.
Specifying different outputs for each target
Proposal
HLB CLI
You'll be able to specify multiple targets like:
hlb run --target foo --target bar
Or specify a target which is a group, more on that below.
New type group
Currently, the only available targets are functions that return fs. One common ask to run multiple targets in parallel, and multiple targets sequentially, so for that we propose a new type group which provides that functionality.
All fs can be thought of as a single element group, but group cannot be passed as a fs.
group default() {
foo
bar
}
fs foo() {
# ...
}
fs bar() {
# ...
}
Like fs, the statements are sequential so foo will execute and complete before we start building the graph for bar.
We also define a group function to execute groups in parallel:
# Runs the given targets in parallel.
#
# @param targets the targets to run in parallel.
# @return a group for parallel execution.
group parallel(variadic group targets)
Using function literals, you can define the build pipeline all in one group:
group foo() {
parallel group {
a
b
} group {
c
d
}
e
}
When executing target foo, a and c will start immediately. b will start when a finishes, d will start when c finishes, and e will start when both a, b, c, d have finished.
Since groups are also functions, you can define parameters, like in this concrete example:
group pullrequest() {
unitTests
lint
}
group ci() {
parallel group {
pullrequest
} group {
parallel group {
integrationTests "staging"
} group {
integrationTests "prod"
}
publish
}
}
group integrationTests(string environment) {
# ...
}
The text was updated successfully, but these errors were encountered:
There's a few use cases for executing multiple targets:
Proposal
HLB CLI
You'll be able to specify multiple targets like:
hlb run --target foo --target bar
Or specify a target which is a
group
, more on that below.New type
group
Currently, the only available targets are functions that return
fs
. One common ask to run multiple targets in parallel, and multiple targets sequentially, so for that we propose a new typegroup
which provides that functionality.All
fs
can be thought of as a single elementgroup
, butgroup
cannot be passed as afs
.Like
fs
, the statements are sequential sofoo
will execute and complete before we start building the graph forbar
.We also define a group function to execute groups in parallel:
Using function literals, you can define the build pipeline all in one group:
When executing target
foo
,a
andc
will start immediately.b
will start whena
finishes,d
will start whenc
finishes, ande
will start when botha
,b
,c
,d
have finished.Since groups are also functions, you can define parameters, like in this concrete example:
The text was updated successfully, but these errors were encountered: