Sparrow is a Linux scripting platform to ease the daily scripting jobs and distribution. In this small post I am going to show you how to share simple Bash tasks with the rest of the world.
Install Sparrow
$ sudo yum install curl
$ cpanm -q --notest Sparrow
Create Bash Task
First of all we need Bash plugin:
$ sparrow index update
$ sparrow plg install bash
Then let's create a task. I always forgot how to install Rvm/Ruby so I want a mnemonic command for this:
$ sparrow project create utils
$ sparrow task add utils ruby-rvm-stable bash
$ EDITOR=nano && sparrow task ini utils/ruby-rvm-stable
command: "\curl -sSL https://get.rvm.io | bash -s stable --ruby"
Share Bash Task
First of all you need to get an account at SparrowHub, because you're going to save your task into the account.
Then having set credentials up:
$ cat ~/sparrowhub.json
{
"user" : "melezhik",
"token" : "*****-****-****-*******-*****"
}
Just upload the task with some useful description:
$ sparrow remote task upload utils/ruby-rvm-stable "Install RVM stable with ruby"
By default your tasks are private so it is only you who can see them. Let's take simple step to changes this:
$ sparrow remote task share utils/ruby-rvm-stable
Running Remote Bash Task
Now the rest of the team could enjoy your little nifty task. To do this they only need Sparrow client installed:
$ sparrow remote task run melezhik@utils/ruby-rvm-stable
Community Remote Tasks
To list SparrowHub community remotes task just say this:
$ sparrow remote task public list
Further reading is Sparrow documentation on remotes tasks.
Conclusion
Sparrow enables creation of scripts in easy and fun manner. Or if you want - "Quick and dirty way to develop some useful script and share with others".