Skip to content

datfooldive/velka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Velka

Build Status

A simple, file-based task runner inspired by hereby, written in Go.

Velka helps you define and run project-specific tasks like building, testing, and linting using a straightforward YAML configuration file.

Features

  • Simple YAML Configuration: Define all your tasks in a single, easy-to-read tasks.yaml file.
  • Task Dependencies: Easily define dependencies between tasks.
  • Parallel Execution: Run multiple tasks concurrently for maximum efficiency.
  • Environment Variables: Set global or per-task environment variables.
  • Custom Directories: Run tasks in specific working directories.
  • Pre/Post Hooks: Execute commands before or after your main task commands.
  • Discoverable Tasks: List all available tasks with a simple command.
  • Dry Run Mode: Preview the tasks and commands that will be executed without running them.

Installation

To get started, clone the repository and build the executable:

git clone https://github.com/kyzsuukii/velka.git
cd velka
go build -o velka .

You can then move the velka executable to a directory in your $PATH to make it available system-wide.

Usage

The Velka CLI is simple and intuitive.

Running Tasks

To run one or more tasks, simply pass their names as arguments:

# Run the default task
./velka

# Run a single task
./velka build

# Run multiple tasks in parallel
./velka test lint

Listing Available Tasks

To see a list of all defined tasks and their descriptions:

./velka list

Flags

  • --file, -f: Specify a custom path for the configuration file (default: tasks.yaml).
  • --dry-run: Print the tasks and commands that would be executed without running them.
./velka --file=ci-tasks.yaml test
./velka --dry-run build

Configuration

All tasks are defined in a tasks.yaml file. Here is a complete example demonstrating all features:

# Global environment variables available to all tasks
env:
  - "GLOBAL_VAR=hello from global"

# The task to run when no arguments are provided
default: test

# The main map of all available tasks
tasks:
  build:
    description: "Builds the main application."
    pre_run:
      - echo "Starting the build..."
    run:
      - echo "Building... ($GLOBAL_VAR)"
    post_run:
      - echo "Build finished."

  test:
    description: "Runs the test suite."
    dependencies:
      - build
    env:
      - "TEST_VAR=hello from test"
    run:
      - 'echo "Testing with var: $TEST_VAR"'

  lint:
    description: "Lints the codebase."
    run:
      - echo "Linting..."

  frontend:
    description: "Runs frontend tasks in its own directory."
    dir: "packages/frontend"
    run:
      - echo "Running frontend task in $(pwd)"

Contributing

Contributions are welcome! Please feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License.

About

A simple, file-based task runner inspired by hereby, written in Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages