taskrunner

Task Runner API

Sparrow Task Runner is an underlying engine to run Sparrow tasks, it has 3 usage flavors:

  1. DSL-like style, plugins

task-run $task-name, $plugin-name, %parameters

Use this method to run Sparrow6 plugins

# Runs vsts-build plugin for build definition JavaApp
task_run "run my build", "vsts-build", %(
  definition => "JavaApp"
);

2. DSL-like style, local tasks

task-run $task-dir, %parameters

Use this method to run local tasks:

# Run default task located at the task directory ./utilities/animals

task-run "utilities/animals", %( hello => 'Cow ');

You can run specific task located at the task directory, by using $task-dir@task-path notation:

# Run birds/tiny task located at the task directory ./utilities/animals:

task-run "utilities/animals@birds/tiny", %( hello => 'Sparrow ');

You can set task root directory to add alternative location where local tasks are searched:

SP6_TASK_ROOT=~/tasks

Then following task will be searched in ./utilities/animals, then in ~/tasks/utilities/animals:

task-run "utilities/animals"

3. Low level API

You probably don't need to use that explicitly, it's used by the first two methods internally, but here is an example of API:

use Sparrow6::Task::Runner;

Sparrow6::Task::Runner::Api.new(
  name  => "bash",
  root  => "examples/plugins/bash",
  do-test => True,
  show-test-result => True,
  debug => True,
  parameters => %(
    command => 'echo $foo',
    debug   => 1,
    envvars => %(
      foo => "BAR"
    )
  )
).task-run;

Sparrow6 v0.0.33

Sparrow is a Raku based automation framework

Authors

  • Alexey Melezhik

License

Artistic-2.0

Dependencies

File::Directory::TreeHash::Merge:ver<1.0.0>YAMLishJSON::TinyData::DumpColorizable

Test Dependencies

Provides

  • Sparrow6
  • Sparrow6::Common::Config
  • Sparrow6::Common::Helpers
  • Sparrow6::DSL
  • Sparrow6::DSL::Assert
  • Sparrow6::DSL::Bash
  • Sparrow6::DSL::CPAN::Package
  • Sparrow6::DSL::Common
  • Sparrow6::DSL::Directory
  • Sparrow6::DSL::File
  • Sparrow6::DSL::Git
  • Sparrow6::DSL::Group
  • Sparrow6::DSL::Package
  • Sparrow6::DSL::Service
  • Sparrow6::DSL::Ssh
  • Sparrow6::DSL::Systemd
  • Sparrow6::DSL::Template
  • Sparrow6::DSL::User
  • Sparrow6::DSL::Zef
  • Sparrow6::RakuTask
  • Sparrow6::SparrowTask
  • Sparrow6::Task
  • Sparrow6::Task::Check
  • Sparrow6::Task::Check::Context
  • Sparrow6::Task::Check::Context::Common
  • Sparrow6::Task::Repository
  • Sparrow6::Task::Repository::Helpers::Common
  • Sparrow6::Task::Repository::Helpers::Index
  • Sparrow6::Task::Repository::Helpers::Init
  • Sparrow6::Task::Repository::Helpers::Plugin
  • Sparrow6::Task::Runner
  • Sparrow6::Task::Runner::Helpers::Bash
  • Sparrow6::Task::Runner::Helpers::Check
  • Sparrow6::Task::Runner::Helpers::Common
  • Sparrow6::Task::Runner::Helpers::Perl
  • Sparrow6::Task::Runner::Helpers::Perl6
  • Sparrow6::Task::Runner::Helpers::Powershell
  • Sparrow6::Task::Runner::Helpers::Python
  • Sparrow6::Task::Runner::Helpers::Ruby
  • Sparrow6::Task::Runner::Helpers::Test

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.