No commit activity in last 3 years
No release in over 3 years
Tumugi plugin to execute a command
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 10.0
~> 3.1

Runtime

>= 0.6.0
 Project Readme

Build Status Code Climate Coverage Status Gem Version

Command plugin for tumugi

tumugi-plugin-command is a tumugi plugin to execute a command.

Installation

Add this line to your application's Gemfile:

gem 'tumugi-plugin-command'

And then execute bundle install.

Task

Tumugi::Plugin::CommandTask

Tumugi::Plugin::CommandTask is task to execute a specified command.

Parameters

  • command command which you want to execute (string, required)
  • output_file output file path. If you specified this parameter, all outputs to STDOUT are saved in this file. (string)

Examples

  • Run command
task :task1, type: :command do
  command "ls -la"
end
  • Run command and save all outputs to STDOUT into file
task :task1, type: :command do
  command "echo 'success'"
  ## If you don't want to output stdout as log, set "quiet" param
  # quiet true
  output_file "result.txt"
end
  • Run external shell script
#!/bin/sh
echo 'success' > tmp/external_script_result.txt
task :task1, type: :command do
  requires :task2
  command { "cat #{input.path}" }
end

task :task2, type: :command do
  command "./examples/external_script.sh"
  output target(:local_file, "tmp/external_script_result.txt")
end

Development

After checking out the repo, run bundle install to install dependencies. Then, run bundle exec rake test to run the tests.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/tumugi/tumugi-plugin-command.

License

The gem is available as open source under the terms of the Apache License Version 2.0.