DEV Community

Discussion on: How to Share Simple Bash Tasks with Others by Using Sparrow

Collapse
 
melezhik profile image
Alexey Melezhik • Edited

Hi! Sparrow's support for hosted solutions is limited. Drop me an issue on GH on this and I'll see what can I do to improve this ( should be a big deal as SparrowHub source code is ready to open source, just stored at private GitLab repo )

As workaround you can use gemote Git repositories to host your private sparrow plugins, the example in the paper could be rewritten as:

Create sparrow plugin


$ git init

$ nano story.bash
curl -sSL https://get.rvm.io | bash -s stable --ruby

$ nano sparrow.json
{
  "name" : "ruby-rvm-stable"
}

$ git add story.bash sparrow.json

$ git commit -a -m "my sparrow plugin to install ruby/rvm"
$ git remote add origin https://github.com/melezhik/ruby-rvm-stable.git
$ git push -u origin master

Spin up custom Sparrow repository and add a plugin to index

Then you have to add plugin to the custom Sparrow repository:


$ nestd start --host 192.168.0.1 --port 4441

$ curl \
 -d name=ruby-rvm-stable \
 -d url=https://github.com/melezhik/ruby-rvm-stable.git \
 -L  192.168.0.1:4441/add

Use Sparrow plugin

And then end user need just need this:


$ echo repo: 192.168.0.1:4441 >> ~/sparrow.yaml 
$ sparrow index update
$ sparrow plg install ruby-rvm-stable
$ sparrow plg run ruby-rvm-stable