Build'em quick, Build'em right
Build'em is a small little script parser that is intended for large build systems.
Features:
Execution: Scripts go in a plain text file, I use my_very_important_task.buildem and then simply call buildem my_very_important_task.buildem
- Build'em supports sequential tasks (tasks that go in order)
Example: run "./task.sh" run "./another.sh" #another.sh waits for task.sh to complete
- Build'em supports a work queue, what does this mean? This means that you can run tasks concurrently, easily.
Example:
unordered do
queued_run "./some_task.sh"
queued_run "./some_task1.sh" # All of these items will be executed at the same time
queued_run "./some_task2.sh"
end
IMPORTANT All queued_run tasks must be inside of an unordered block if you want them to run at the same time. If you use run for a task, it will block to complete. That being said you can inject ordered tasks in the middle of unordered tasks by using run instead of using qeueued_run if you wish to.
- Configuration To set the worker amount for unordered tasks before the unordered block do $configuration.workers = 10 to get 10 nano-bots working for you.
Example:
$configuration.workers = 5
unordered do
....
end
This will give you 5 nano-bots for your unordered tasks
optional run and queued_run options
- :retry_amount (Integer that specifies that you want to retry the execution of the provided command. Default is 1 execution.)
- :retry_condition (Integer, regular expression, or string that specifies what a good execution is. Default is 0 if not specified.)
- :quit_on_error (Boolean that specifies if build'em should quit when an exception happens executing the provided command. Default is true)
Notice If the retry_condition is not met within the retry_amount interval an error will be throw unless :quit_on_error is set to false
Logging
If you wish to log all of the output to a specific file you can do so with an output_to block
Example:
output_to "my_nifty_output_file.txt" do
run "./task.sh"
run "./another.sh"
unordered do
queued_run "./some_task.sh"
queued_run "./some_task1.sh"
queued_run "./some_task2.sh"
end
end
- output_to parameters
filename: The filename that you wish to output to (optional, default is output.log) IO capture: possible values :stdout, :stderr etc (optional, default is :stdout)
output_to do ... will save all stdout output to output.log
output_to "another_file.txt" do ... same as above but would be saved to another_file.txt
output_to "err.txt", :stderr do ... will output all stderr to err