All Projects β†’ samsarahq β†’ taskrunner

samsarahq / taskrunner

Licence: MIT license
πŸ‘ a configurable task runner written in go

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to taskrunner

EasyJob
πŸ”¨ EasyJob - keep and execute your PowerShell and BAT scripts from one interface
Stars: ✭ 228 (+714.29%)
Mutual labels:  task, runner
duty
A simple task runner.
Stars: ✭ 36 (+28.57%)
Mutual labels:  task, runner
lets
CLI task runner for developers - a better alternative to make
Stars: ✭ 50 (+78.57%)
Mutual labels:  task, runner
taskit
A Task Runner in Bash
Stars: ✭ 35 (+25%)
Mutual labels:  task, runner
Maid
Markdown driven task runner.
Stars: ✭ 1,999 (+7039.29%)
Mutual labels:  task, runner
tasuku
βœ… γ‚Ώγ‚Ήγ‚― β€” The minimal task runner for Node.js
Stars: ✭ 1,488 (+5214.29%)
Mutual labels:  task, runner
Bake
Bake is a bash task runner
Stars: ✭ 27 (-3.57%)
Mutual labels:  task, runner
Flowa
πŸ”₯Service level control flow for Node.js
Stars: ✭ 66 (+135.71%)
Mutual labels:  task, runner
Drome
JavaScript task runner
Stars: ✭ 135 (+382.14%)
Mutual labels:  task, runner
Runner
Simple, lightweight task runner for Bash.
Stars: ✭ 133 (+375%)
Mutual labels:  task, runner
Task Easy
A simple, customizable, and lightweight priority queue for promises.
Stars: ✭ 244 (+771.43%)
Mutual labels:  task, runner
Nake
Magic script-based C# task runner for .NET Core
Stars: ✭ 183 (+553.57%)
Mutual labels:  task, runner
nano-staged
Tiny tool to run commands for modified, staged, and committed files in a GIT repository.
Stars: ✭ 347 (+1139.29%)
Mutual labels:  task, runner
wp-queue-tasks
Create and process tasks asynchronously in WordPress
Stars: ✭ 17 (-39.29%)
Mutual labels:  task
ComposableAsync
Create, compose and inject asynchronous behaviors in .Net Framework and .Net Core.
Stars: ✭ 28 (+0%)
Mutual labels:  task
YACLib
Yet Another Concurrency Library
Stars: ✭ 193 (+589.29%)
Mutual labels:  task
maker
Maker is a advanced mobile ToDo app for Android and iOS
Stars: ✭ 35 (+25%)
Mutual labels:  task
Swatch
Watcher for Unit Tests written in Swift
Stars: ✭ 55 (+96.43%)
Mutual labels:  runner
uiLogos-sketch-plugin
Sketch plugin to Insert professionally designed dummy logos of companies and 190+ country flag into SketchApp
Stars: ✭ 26 (-7.14%)
Mutual labels:  runner
jest-runner-go
A Golang runner for Jest
Stars: ✭ 22 (-21.43%)
Mutual labels:  runner

Taskrunner

A configurable taskrunner written in Go. Taskrunner can streamline your build system by creating reusable task definitions with names, descriptions, dependencies, and a run function written in Go. Taskrunner comes with a shell interpreter, so it can run arbitrary functions on the command line.

Setup

Add taskrunner as a dependency go get -v github.com/samsarahq/taskrunner, and create the following main.go file:

package main

import (
	"github.com/samsarahq/taskrunner"
	"github.com/samsarahq/taskrunner/clireporter"
)

func main() {
	taskrunner.Run(clireporter.StdoutOption)
}

Run a task

Taskrunner can be started by running go run ., it is possible to limit log output with PRINT_LOG_LEVEL=error. To run an individual task specify the task name go run . my/task. For a full list of tasks use go run . -describe, or for a list of names go run . -list. It may be a good idea to alias taskrunner to run taskrunner.

Example tasks

Add a tasks.go file, this contains all task descriptions:

package main

import (
	"context"

	"github.com/samsarahq/taskrunner"
	"github.com/samsarahq/taskrunner/goextensions"
	"github.com/samsarahq/taskrunner/shell"
)

// Run a simple task.
var myTask = taskrunner.Add(&taskrunner.Task{
	Name:         "my/task",
	Run: func(ctx context.Context, shellRun shell.ShellRun) error {
		return shellRun(ctx, `echo Hello World`)
	},
})

// Run a task depending on another task.
var myDependentTask = taskrunner.Add(&taskrunner.Task{
	Name:         "my/dependent/task",
	Dependencies: []*taskrunner.Task{myTask},
	Run: func(ctx context.Context, shellRun shell.ShellRun) error {
		return shellRun(ctx, `echo Hello Again`)
	},
})


// Run a task which monitors a file and reruns on changes
// a change will also invalidate dependencies.
var myGoTask = taskrunner.Add(&taskrunner.Task{
	Name:         "my/go/task",
	Description:  "Run a go file and re-run when it changes",
	Run: func(ctx context.Context, shellRun shell.ShellRun) error {
		return shellRun(ctx, `cd src/example && go run .`)
	},
	Sources: []string{"src/example/**/*.go"},
})

// Run a task using WrapWithGoBuild to automatically setup
// invalidation for the task according to the import graph
// of the specified package.
var builder = goextensions.NewGoBuilder()

var myWrappedTask = taskrunner.Add(&taskrunner.Task{
	Name: "my/wrapped/task",
        Run: func(ctx context.Context, shellRun shell.ShellRun) error {
		return shellRun(ctx, `example`)
	},
}, builder.WrapWithGoBuild("example"))

Default tasks to run

It is possible to add a workspace.taskrunner.json file, this contains the default tasks to run when taskrunner is run without any arguments.

{
  "path": "./",
  "desiredTasks": [
    "my/task"
  ]
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].