Package: b5
b5 Task Runnerb5 is the central task runner for all projects of our agency (TEAM23 -www.team23.de). It tries to be as simple
as possible while empowering you to write your own tasks, extend existing ones and use b5 for all of the everyday
project jobs.Basic usage and conceptb5 {taskname}will look for a file calledTaskfilefound under build/ in your project
root. It will then execute the function namedtask:{taskname}inside the Taskfile (which is a normal bash script).
This means you may callb5 installto have the functiontask:installrun.The basic idea of b5 is to allow you to easily put your daily shell jobs into the Taskfile and provide a
common schema for running these tasks. Sob5 cssfor example will always build the CSS files for your
project regardless of the CSS preprocessor used in this particular project (could be: less, sass, …). As b5
uses bash scripting as the Taskfile format it is easy to understand and enhance.b5 in addition provides some modules to ease the usage of some common tools used in web development (likenpm,composer,pipenv,docker, …). In addition it defines somecommon task namesto introduce a good convention for your task naming schema. This
will allow new developers to get on board faster - not need to care too much about the
project setup itself.You may pass parameters to your tasks likeb5 some_task some_parameterand use normal bash parameter handling
to use these parameters ($1, or better${1}). Please note that b5 will abort when accessing a non existent
parameter, use bash default values when necessary (${1:-default}).Hint:You may add a file called Taskfile.local (build/Taskfile.local) for all your personal tasks. Make
sure to never add this file to git. Please be sure to add this file to your .gitignore. Otherwise you might
interfere with the local Taskfile of your colleges.Quick startInstall b5 usingpipx install b5orpip install b5(For Mac OS X you may usebrew install b5after
adding our tap). Seedetailed installation instructions.Note for my TEAM23 colleagues:Please make sure to install theadditional dependencies.Starting your projectb5-initexample-projectcdexample-project# start working on the new projectNote:You may useb5-init -s $SKELETON exampleto initialize the project using an skeleton. By default
b5 will use the "basic" skeleton. Seeproject initializationfor more details.Defining your tasks (build/Taskfile)b5 initialized your project with an example Taskfile (seebuild/Taskfile). For adding new tasks just
write bash functions prefixed withtask:, like:#!/usr/bin/env bash# b5 Taskfile, see https://git.team23.de/build/b5 for detailstask:make_it_happen(){echo"Yeah, it happened"}Running your tasksNow you can useb5 make_it_happenand your code inside the function will run. As this code is a simple
bash script you may use your normal command line tools. Feel free to use gulp, grunt, fabric, … for more
complex task excution - and call these using your Taskfile.Note:The Taskfile is always executed inside the "run-path", which defaults tobuild/. Make
sure to switch path, when neccessary. I recommend using a subshell (see"( … )" subshell syntax) when
doing so.Going furtherNow you set up a simple example project including an example Taskfile. The Taskfile is the central part of
the b5 task runner which will include the calls to all of the provided tasks. Most of the tasks will
call external tools like, gulp or fabric. This is the intended behavior.Seedetailed installation instructionfor some more details the installation of b5.Seecore conceptsfor some more details about the b5 concepts.SeeTaskfile formatfor more details on how to write your Taskfile.Seecommon tasksfor information about which tasks your Taskfile needs
to provide and what these tasks should do.SeeConfigurationfor about how to add configuration to the build process and how
to handle local configuration.Seemodulesfor looking further into modules b5 already provides for a healthy
project setup.Seeproject initializationfor more information about how tob5-inita project.b5 logoYou may use the b5 logo when referring to b5:(seeassets/for other formats)Also feel free to add a b5 badge to your project after you made it "b5 ready":(seeassets/badges/for other formats)