npm install bootme
- Hooks: define
Init
,Before
,After
,Rollback
Hooks in the Task or with the Registry. - Rollback: the pipeline behaves fully transactional. Define rollback routines which are triggered as soon as a
Hook
,Task
or aJob
or nested thing fail. - Configuration: configure your Task with JSON or pass an inquirer prompt to setup your config at runtime.
- Composable: work with results of previous Tasks, pass Tasks to Hooks or add Tasks in Tasks.
- 100% asynchronous: all the core is implemented with asynchronous code. ES7 allow us to write good readable code.
- Validation: you can validate the result and config of your Task with Joi.
- CLI Wizards: create beautiful Command-line Wizards with ease.
- Queue: the order of execution is guaranteed thanks to Workq package.
const Bootme = require('bootme')
const registry = new Bootme.Registry()
const pipeline = new Bootme.Pipeline(registry)
// Share configuration across all tasks
registry.shareConfig({
TOKEN: process.env.TOKEN
})
class SampleTask extends Bootme.Task {
constructor(name) {
super(name)
}
async init(state) {}
async action(state) {}
async validateResult(value) {}
async validateConfig(value) {}
async rollback(state) {}
}
const task = new SampleTask('sample')
task.setConfig({ a: 1 })
// Add task
registry.addTask(task)
// Add hooks after registration "onInit", "onAfter", "onBefore"
registry.addHook('sample', 'onRollback', async (state) => ...)
// Add Global pipeline hooks "onTaskStart", "onTaskEnd", "onTaskRollback"
pipeline.onRollbackFinish(async () => ...)
// Execute or restore pipeline
pipeline.execute()
pipeline.restore()
General | Version | Description |
---|---|---|
bootme-cli | Run Bootme Tasks from the console | |
bootme-json-runner | Load pipeline configuration from JSON | |
bootme-task-spinner | Elegant terminal spinner when your Tasks are running |
General | Version | Description |
---|---|---|
bootme-githook | Cross-platform git hooks | |
bootme-request | Start HTTP request | |
bootme-gitclone | Clone a Git Repository | |
bootme-template | Mustache Templating | |
bootme-shell | Portable Unix shell commands | |
bootme-docker | Docker commands | |
bootme-temp | Get a random temporary file or directory path | |
bootme-delay | Include a delay |
General | Version | Description |
---|---|---|
bootme-projectx | Example of how to share a JSON pipeline definition |
Gulp is a tookit to work with streams, transform or move bytes from one place to another. While you can parallize stuff in Gulp, in BootMe you can't, we don't want! Bootstrapping an environment from scratch or setup projects are error-prone this means we should be able to define a rollback mechanism to come back in a clear state and try it again. BootMe Task-Pipeline is ordered and as soon a task fail, the pipeline is trying to recover itself. You can hook into many lifecycle events. In Gulp you can pipe streams to other tasks this is quite useful because you can build modules which are composable. In BootMe it's quite different. We don't agree on streams, we respond native Javascript Objects. A task can rely on the output of another task. This is possible, because a Task can define refs
which is part of the task configuration and defines a relation between them. When the value can not be found we trying to fallback to the default configuration. We are also able to validate the config and the result of a task. In Gulp you don't want it because the correctnes of the stream data could be reached only near the end.
BootMe is no replacement for Gulp, we use Gulp e.g in bootme-template
to manipulate files and replace them with the orginal content.
Grunt is more similiar to BootMe as Gulp because in Grunt you have a sequential execution order of you tasks. Grunt don't rely on streams you can do everything inside a task but Grunt don't respect transactionality, a task can fail or another task can succeed. Therefore grunt don't provide an easy way to handle errors or hooks into specific lifecycle events. Grunt don't handle config and output validation for you, you have to extend it manually. The goal of grunt is to provide a general solution of running any kind of task but that's not exact our goal with BootMe. BootMe was designed to provide an elegant API to handle a list of tasks as a transaction and rollback the tasks of the pipeline when an error occur. Another big difference related to the technology is that BootMe is written in ES7. You can have fun!
BootMe is no replacement for Grunt, grunt is a great tool to automate your asset build pipeline.
Yes, we provide a JSON runner bootme-json-runner. If you pass a Javascript Object you can even hook into the lifecycle.
Yes, we provide great tooling with bootme-cli
Yes, look at example project bootme-projectx there we defined the pipeline in Javascript and published it to NPM (As convention all packages has to started with bootme-*
). After you have successfully published your package you can execute your pipeline with one command with bootme-cli.
lerna run test
We use the excellent Debug package.
$env:DEBUG = "bootme:*" // Windows